#include <iostream>
using namespace std;
void output( int a[6]){
for(int i=0; i<6; i++){
cout<< a[i] <<" ";
}
}
void input( int a[6][6]){
for(int i=0; i<6; i++){
for(int j=0; j<6; j++){
cin >> a[i][j];
}
}
}
int EQ(int a[6][6], int b[6][6], int c[6]){
for(int i=0; i<6; i++){
int t=0, g=0;
for(int j=0; j<6; j++){
if( a[i][j] < 0 ){
t++;
}
}
for(int j=0; j<6; j++){
if( b[i][j] < 0 ){
g++;
}
}
c[i]= t == g? 1 : 0;
}
}
int main() {
int a[6][6], b[6][6];
int c[6];
input(a);
input(b);
EQ(a, b, c);
output(c);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdm9pZCBvdXRwdXQoIGludCBhWzZdKXsKCWZvcihpbnQgaT0wOyBpPDY7IGkrKyl7CgkJY291dDw8IGFbaV0gPDwiICI7Cgl9Cn0KCnZvaWQgaW5wdXQoIGludCBhWzZdWzZdKXsKCWZvcihpbnQgaT0wOyBpPDY7IGkrKyl7CgkJZm9yKGludCBqPTA7IGo8NjsgaisrKXsKCQkJY2luID4+IGFbaV1bal07CgkJfQoJfQp9CgppbnQgRVEoaW50IGFbNl1bNl0sIGludCBiWzZdWzZdLCBpbnQgY1s2XSl7Cglmb3IoaW50IGk9MDsgaTw2OyBpKyspewoJCWludCB0PTAsIGc9MDsKCQlmb3IoaW50IGo9MDsgajw2OyBqKyspewoJCQlpZiggYVtpXVtqXSA8IDAgKXsKCQkJCXQrKzsKCQkJfQoJCX0KCQlmb3IoaW50IGo9MDsgajw2OyBqKyspewoJCQlpZiggYltpXVtqXSA8IDAgKXsKCQkJCWcrKzsKCQkJfQkKCQl9CgkJY1tpXT0gdCA9PSBnPyAgMSA6IDA7Cgl9Cn0KCmludCBtYWluKCkgewoJaW50IGFbNl1bNl0sIGJbNl1bNl07CglpbnQgY1s2XTsKCWlucHV0KGEpOwoJaW5wdXQoYik7CglFUShhLCBiLCBjKTsgCglvd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