// 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