import java.util.*;
import java.lang.*;
import java.io.*;


public class Main
{
	
	private static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
	private static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
	
	public static int nextInt() throws IOException{
		in.nextToken();
		return (int)in.nval;
	}
	
	
	public static void read(int[][] a)  throws IOException{
		int n = a.length;
		int m = a[0].length;
		for(int i = 0;  i < n; i++){
			for(int j = 0; j < m; j++){
				a[i][j] = nextInt();
			}
		}
	}
	
	
	public static void print(int[] a){
		int m = a.length;
		for(int j = 0; j < m; j++){
			out.print(a[j]);
		}
		out.println();
	}
	
	
	public static void EQ(int[][] a, int[][] b, int[] c){ 
		for(int i = 0; i < a.length; i++){
			
			int t=0, g=0;
			
			for(int j=0; j < a.length; j++){
				if( a[i][j] < 0 ){
					t++;
				}
			}
			
			for(int j=0; j < b.length; j++){
				if( b[i][j] < 0 ){
					g++;
				}	
			}
			
			c[i] = t == g? 1 : 0;
		}
	}
	
	
	public static void main (String[] args) throws java.lang.Exception
	{
		int [][] a = new int[6][6], b = new int[6][6];
		int [] c = new int [6];
		read(a);
		read(b);
		EQ(a,b,c);
		print(c);
		out.flush();
	}
}
