#include <bits/stdc++.h>

using namespace std;

int main() {
#ifndef EOLIMP
    freopen("/home/lionell/Developing/acm/e-olymp/1/in.txt", "r", stdin);
#endif
    int n = 0;
    scanf("%d", &n);
    printf("%d %d", n / 10, n % 10);
    printf("\n");
    return 0;
}