#include <iostream>
using namespace std;

int main() {
	// i see where it comes it happens its over
    int x;
    cin>>x;
    cout<<x/10<<" "<<x%10;
	return 0;
}