#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(ll i=0;i> N; ll c=N/3,r=N%3; for(i=1;i<=3;i++){ for(j=1;j<=3;j++){ a[i][j]=c; } } if(r==2){ if(c%2==0){ for(i=1;i<=3;i++) for(j=1;j<=2;j++) a[i][j]++; } else{ for(i=1;i<=2;i++) for(j=1;j<=3;j++) a[i][j]++; } } if(r==1){ if(c%2==0){ for(i=1;i<=3;i++) a[i][1]++; } else{ for(j=1;j<=3;j++) a[1][j]++; } } for(i=1;i<=3;i++){ for(j=1;j<=3;j++) cout << a[i][j] << ' '; cout << endl; } return 0; }