import java.util.*;
import java.lang.*;
import java.io.*;
public class Main
{
in.nextToken();
return (int)in.nval;
}
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;
}
}
{
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();
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgoKcHVibGljIGNsYXNzIE1haW4KewoJCglwcml2YXRlIHN0YXRpYyBTdHJlYW1Ub2tlbml6ZXIgaW4gPSBuZXcgU3RyZWFtVG9rZW5pemVyKG5ldyBCdWZmZXJlZFJlYWRlcihuZXcgSW5wdXRTdHJlYW1SZWFkZXIoU3lzdGVtLmluKSkpOwoJcHJpdmF0ZSBzdGF0aWMgUHJpbnRXcml0ZXIgb3V0ID0gbmV3IFByaW50V3JpdGVyKG5ldyBPdXRwdXRTdHJlYW1Xcml0ZXIoU3lzdGVtLm91dCkpOwoJCglwdWJsaWMgc3RhdGljIGludCBuZXh0SW50KCkgdGhyb3dzIElPRXhjZXB0aW9uewoJCWluLm5leHRUb2tlbigpOwoJCXJldHVybiAoaW50KWluLm52YWw7Cgl9CgkKCQoJcHVibGljIHN0YXRpYyB2b2lkIHJlYWQoaW50W11bXSBhKSAgdGhyb3dzIElPRXhjZXB0aW9uewoJCWludCBuID0gYS5sZW5ndGg7CgkJaW50IG0gPSBhWzBdLmxlbmd0aDsKCQlmb3IoaW50IGkgPSAwOyAg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