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