#include <iostream>
#include <vector>
using namespace std;
int main(int argc, char* argv[]){
int N;
cin >> N;
int startNum = 1;
for(int i = 0; i < N; ++i){
startNum += i;
cout << startNum << " ";
int startPlus = i + 2;
for(int j = 1; j < N - i; ++j){
cout << startNum + startPlus << " ";
startPlus += i + j + 2 ;
}
cout << endl;
}
return 0;
}