char s[9];n=1023,i,x;main(y){for(;gets(s);)for(n&=*s>78?x:~x,x=0;scanf("%d",&y)+1>>1;x|=1<