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