#include <stdio.h>
void transpose(int mtx[3][3])
{
int t;
t = mtx[0][1]; mtx[0][1] = mtx[1][0]; mtx[1][0] = t;
t = mtx[0][2]; mtx[0][2] = mtx[2][0]; mtx[2][0] = t;
t = mtx[2][1]; mtx[2][1] = mtx[1][2]; mtx[1][2] = t;
}
int main()
{
int i;
int mtx[3][3];
for (i = 0; i < 3; ++i){
scanf("%d %d %d", &mtx[i][0], &mtx[i][1], &mtx[i][2]);
}
transpose(mtx);
for (i = 0; i < 3; ++i){
printf("%d %d %d\n", mtx[i][0], mtx[i][1], mtx[i][2]);
}
return 0;
}