#include using namespace std; #ifdef TEMPURA #else #define debug(...) ((void)0) #define msg(...) ((void)0) #endif #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define REP(i, m, n) for(int i = (int)(m); i < (int)(n); i++) using ll = long long; using ull = unsigned long long; using i128 = __int128_t; template inline bool chmin(T &a, T b) { if(a > b) { a = b; return true; } return false; } template inline bool chmax(T &a, T b) { if(a < b) { a = b; return true; } return false; } // #include // using mint = atcoder::modint998244353; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; cin >> n; vector a(n, vector(n, 0)), b(n, vector(n, 0)); rep(i, n) rep(j, n) { a[i][j] = i + 1; b[i][j] = j + 1; if((i + j) % 2 == 0) { swap(a[i][j], b[i][j]); } } rep(i, n) rep(j, n) cout << a[i][j] << " \n"[j + 1 == n]; rep(i, n) rep(j, n) cout << b[i][j] << " \n"[j + 1 == n]; return 0; }