#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int A[20][20];
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
if(i + j == n - 1) A[i][j] = 0;
else if (i + j < n - 1) A[i][j] = 2;
else A[i][j] = 1;
}
}
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++)
cout << A[i][j];
cout << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgbjsKCWNpbiA+PiBuOwoJaW50IEFbMjBdWzIwXTsKCWZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKXsKCQlmb3IgKGludCBqID0gMDsgaiA8IG47IGorKyl7CgkJCWlmKGkgKyBqID09IG4gLSAxKSBBW2ldW2pdID0gMDsKCQkJZWxzZSBpZiAoaSArIGogPCBuIC0gMSkgQVtpXVtqXSA9IDI7CgkJCWVsc2UgQVtpXVtqXSA9IDE7CgkJfQoJfQoJZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspewoJCWZvciAoaW50IGogPSAwOyBqIDwgbjsgaisrKQoJCQljb3V0IDw8IEFbaV1bal07CgkJCWNvdXQgPDwgZW5kbDsKCX0KCXJldHVybiAwOwp9