#include <iostream>
#include <string>
using namespace std;
int main()
{
int x[8] = {0,0,0,0,1,1,1,1};
int y[8] = {0,0,1,1,0,0,1,1};
int z[8] = {0,1,0,1,0,1,0,1};
int f[8] = {1,1,1,0,1,1,0,0};
int t[8];int k = -1,n = 7,q = 0;
for (int i = 0; i < 8; i++)
cout<<f[i]<<" ";
cout<<endl;
while(n > 1)
{
for (int i = 0; i < n; i++)
{
if(f[i]==1&&f[i+1]==1){f[i]=0;}
if(f[i]==0&&f[i+1]==0){f[i]=0;}
if(f[i]==1&&f[i+1]==0){f[i]=1;}
if(f[i]==0&&f[i+1]==1){f[i]=1;}
}
for (int i = 0; i < n; i++)
cout<<f[i];
cout<<endl;
n--;
}
return 0;
}