#include <iostream>
using namespace std;

int main() {
	// your code goes here
	int x; 
	cin>>x;
	cout<<x/10<<" "<<x%10;
	return 0;
}