#include <iostream>
using namespace std;
void swap(int &a,int &b)
{
int temp=a;
a=b;
b=temp;
}
void Reverse(int (*a)[3],int n)
{
int i,j;
for(i=0;i <n;i++)
{
for(j=i+1;j <n;j++)
swap(a[i][j],a[j][i]);
}
}
void main()
{
int a[3][3],i,j;
for(i=0;i <3;i++)
{
for(j=0;j <3;j++)
cin> > a[i][j];
}
Reverse(a,3);
for(i=0;i <3;i++)
{
for(j=0;j <3;j++)
cout < <a[i][j] < < ' ';
cout < <endl;
}
}