import java.util.Scanner;
public class asd {
public static void main(String[] args) {
int a[]= {0,0,0,0,0,0,0,0};
int b[]= {0,0,0,0,0,0,0,0};
int c[]= {0,0,0,0,0,0,0,0};
int d[]= {0,0,0,0,0,0,0,0};
int e[]= {0,0,0,0,0,0,0,0};
int f[]= {0,0,0,0,0,0,0,0};
int i,j,k=0,win,y=0;
int play=2,con=0,player1=0,player2=0;
do{
for(i=0;i<7;i++)
{a[i] = 0;
b[i] = 0;
c[i] = 0;
d[i] = 0;
e[i] = 0;
f[i] = 0;}
play =2;
do{
win=0;
for(j=0;j<=20;j++)
System.out.print("\n");
System.out.print("5 | ");
for(j=0;j<=6;j++)
System.out.print(f[j] +" ");
System.out.print("\n4 | ");
for(j=0;j<=6;j++)
System.out.print(e[j] +" ");
System.out.print("\n3 | ");
for(j=0;j<=6;j++)
System.out.print(d[j] +" ");
System.out.print("\n2 | ");
for(j=0;j<=6;j++)
System.out.print(c[j] +" ");
System.out.print("\n1 | ");
for(j=0;j<=6;j++)
System.out.print(b[j] +" ");
System.out.print("\n0 | ");
for(j=0;j<=6;j++)
System.out.print(a[j] +" ");
System.out.print("\n ");
for(j=0;j<=12;j++)
System.out.print("-");
System.out.print("\n 0 1 2 3 4 5 6\n");
for(j=0;j<=3;j++){
if(a[j] ==y && a[j+1] ==y && a[j+2] ==y && a[j+3] ==y)
win++;
else if(b[j] ==y && b[j+1] ==y && b[j+2] ==y && b[j+3] ==y)
win++;
else if(c[j] ==y && c[j+1] ==y && c[j+2] ==y && c[j+3] ==y)
win++;
else if(d[j] ==y && d[j+1] ==y && d[j+2] ==y && d[j+3] ==y)
win++;
else if(e[j] ==y && e[j+1] ==y && e[j+2] ==y && e[j+3] ==y)
win++;
else if(f[j] ==y && f[j+1] ==y && f[j+2] ==y && f[j+3] ==y)
win++;
}
for(j=0;j<=5;j++)
if(a[j] ==y && b[j] ==y && c[j] ==y && d[j] ==y)
win++;
else if(b[j] ==y && c[j] ==y && d[j] ==y && e[j] ==y)
win++;
else if(c[j] ==y && d[j] ==y && e[j] ==y && f[j] ==y)
win++;