#include
#include <bits/stdc++.h>
using namespace std;
// Function to rotate the matrix 90 degree clockwise
void rotate90Clockwise(int a[1000][1000],int N)
{
// Traverse each cycle
for (int i = 0; i < N / 2; i++) {
for (int j = i; j < N - i - 1; j++) {
// Swap elements of each cycle
// in clockwise direction
int temp = a[i][j];
a[i][j] = a[N - 1 - j][i];
a[N - 1 - j][i] = a[N - 1 - i][N - 1 - j];
a[N - 1 - i][N - 1 - j] = a[j][N - 1 - i];
a[j][N - 1 - i] = temp;
}
}
}
// Function for print matrix
void printMatrix(int arr[1000][1000],int N)
{
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++)
cout << arr[i][j] << " ";
cout << ‘\n’;
}
}
// Driver code
int main()
{
int arr[1000][1000];
int N;
cin>>N;
int k,l;
for(k=0;k<N;k++)
{
for(l=0;l<N;l++)
{
cin>>arr[k][l];
}
}
rotate90Clockwise(arr,N);
printMatrix(arr,N);
return 0;
}