/*
#include <iostream>
#include <vector>
using namespace std;
int num[101];
int total, connect;
vector<vector<int> > graph;
void f(int x, int y)
{
for(int i=0; i<=total; i++)
{
if(y+i>total) return;
if(graph[x][y+i]>0)
{
graph[x][y+i]--;
graph[y+i][x]--;
num[y+i]=1;
f(y+i,0);
}
}
}
int main()
{
int x, y;
cin>>total>>connect;
for(int i=0; i<=total+1; i++)
{
vector<int> v;
for(int j=0; j<=total+1; j++)
{
v.push_back(0);
}
graph.push_back(v);
}
for(int i=1; i<=connect; i++)
{
cin>>x>>y;
graph[x][y]=1;
graph[y][x]=1;
}
f(1,1);
int sum = 0;
num[1] = 0;
for(int i=1; i<=total; i++) {
sum += num[i];
}
cout << sum;
}
*/
#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<vector<int> > graph;
vector<int> ans;
vector<int> sol;
int num=1,N=1,answer,Num=2;
int solution(int n, vector<vector<int> > edge,int x)
{
for(int i=0; i<n; i++)
{
ans.push_back(0);
sol.push_back(0);
}
for(int j=1; j<=n; j++)
{
cout<<x<<' '<<j<<' '<<edge[x][j]<<endl;
if(edge[x][j]==1)
{
cout<<'N'<<endl;
sol[N++]=j;
ans[Num++]=num;
edge[x][j]=0;
edge[j][x]=0;
for(int i=1; i<=6; i++)
{
for(int j=1; j<=6; j++)
{
cout<<edge[i][j]<<' ';
}
cout<<endl;
}
}
}
num++;
x++;
solution(n,edge,sol[x]);
answer = 0;
return answer;
}
int main()
{
for(int i=0; i<=7; i++)
{
vector<int> v;
for(int j=0; j<=7; j++)
{
v.push_back(0);
}
graph.push_back(v);
}
graph[3][6]=1;
graph[4][3]=1;
graph[3][2]=1;
graph[1][3]=1;
graph[1][2]=1;
graph[2][4]=1;
graph[5][2]=1;
graph[6][3]=1;
graph[3][4]=1;
graph[2][3]=1;
graph[3][1]=1;
graph[2][1]=1;
graph[4][2]=1;
graph[2][5]=1;
solution(6,graph,1);
for(int i=1; i<=6; i++)
{
for(int j=1; j<=6; j++)
{
cout<<graph[i][j]<<' ';
}
cout<<endl;
}
cout<<answer;
}