#include using namespace std; #define int long long typedef pair P; int INF = 1e9+7; int mod = 1e9+7; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; signed main() { int N; cin >> N; string S = ""; for(int i = 0; i < N; i++) { S += 'Z'; } for(int i = 0; i < N; i++) { string T = S; int cnt = i+1; for(int j = i; j >= 0; j--) { char c = (cnt+'0'); T[j] = c; cnt++; if(cnt == N+1) { cnt = 1; } } for(int j = N-1; j > i; j--) { char c = (cnt+'0'); T[j] = c; cnt++; if(cnt == N+1) { cnt = 1; } } for(int j = 0; j < N; j++) { if(j) { cout << " "; } cout << T[j]; } cout << endl; } }