#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int n;
if (!(cin >> n)) return 0;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
cout << setw(3) << (i + j == n - 1 ? 1 : 0);
}
cout << '\n';
}
return 0;
}
/**************************************************************
Problem: 1191
User: 231308061
Language: C++
Result: Accepted
Time:23 ms
Memory:2072 kb
****************************************************************/