//Image Rotation
//rotating the matrix clockwise by 90 degrees
//First taking the transpose of the matrix then exchanging the rows
#include
using namespace std;
int main()
{
int i,j;
int rows,column,k;
int a[100][100];
cin>>k;
for(i=0;i<k;i++)
{
for(j=0;j<k;j++)
{
cin>>a[i][j];
}
}
for(i=0;i<k;i++)
{
int temp;
temp = a[i][0];
a[i][0] = a[i][k-1];
a[i][k-1]=temp;
}
for(i=0;i<k;i++)
{
for(j=0;j<k;j++)
{
cout<<a[j][i]<<" ";
}
cout<<endl;
}
return 0;
}