// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <iomanip>
#define dibs reserve
#define OVER9000 1234567890
#define patkan 9
#define tisic 47
#define soclose 10e-7
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define chocolate win
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):(x))
// mylittlepony
using namespace std;
void count(int i, int j, int k, vector< vector< vector<int> > > &St) {
// cout << i << " " << j << " " << k << endl;
if(St[k][i][j] >= 0) return;
int i2 =i+(int)(k == 2);
St[k][i][j] =0;
int k2 =(k+1)%3; if(k2 < 0) k2 +=3;
if(i > 0) {
count(i2-1,j,k2,St);
if(0 == St[k2][i2-1][j]) St[k][i][j] =1;}
if(i > 0) {
count(i2-1,j+1,k2,St);
if(0 == St[k2][i2-1][j+1]) St[k][i][j] =1;}
if(j > 0) {
count(i2,j-1,k2,St);
if(0 == St[k2][i2][j-1]) St[k][i][j] =1;}}
int main() {
cin.sync_with_stdio(0);
vector< vector< vector<int> > > St(3);
St[0].resize(100, vector<int>(100,-1));
St[1].resize(100, vector<int>(100,-1));
St[2].resize(100, vector<int>(100,-1));
for(int i =0; i < 10; i++) for(int j =0; j < 10; j++) for(int k =2; k >= 0; k--)
count(i,j,k,St);
for(int i =0; i < 10; i++) for(int j =0; j < 10; j++) {
int x =St[0][i][j]+2*St[1][i][j]+4*St[2][i][j];
cout << x << " ";
if(j == 9) cout << "\n";}
return 0;}
// look at my code
// my code is amazing
Ly8gaW9zdHJlYW0gaXMgdG9vIG1haW5zdHJlYW0KI2luY2x1ZGUgPGNzdGRpbz4KLy8gYml0Y2ggcGxlYXNlCiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPHNldD4KI2luY2x1ZGUgPG1hcD4KI2luY2x1ZGUgPHN0cmluZz4KI2luY2x1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