#include int main(){ int n=1023,t,i,x,y; char s[4]; scanf("%d",&t); while(t--){ x=0;i=4;while(i--){scanf("%d",&y);x|=1<