#include using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int N; cin >> N; for(int i = 0; i < N; i++) { for(int j = 0; j < N; j++) { if((i + j) % 2 == 0) { cout << i + 1 << " "; } else { cout << j + 1 << " "; } } cout << "\n"; } for(int i = 0; i < N; i++) { for(int j = 0; j < N; j++) { if((i + j) % 2 == 0) { cout << j + 1 << " "; } else { cout << i + 1 << " "; } } cout << "\n"; } return 0; }