//problem in calling the function
#include
using namespace std;
void rotate(int n, int arr[][100]){
for (int row = 0; row < n; ++row)
{
for (int col = 0; col < n; ++col)
{
int x=0;
int y=n-1;
while(x<y){
swap(arr[row][x],arr[row][y]);
x++;
y--;
}
}
}
}
int main()
{
int n;
cin>>n;
int row,col;
int arr[n][n];
int val=1;
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < n; ++j)
{
arr[i][j]=val;
val++;
}
}
rotate(n,arr);
return 0;
}