// 36進数にしたら伸びてカス #import using namespace std;int x[99],m,c,z,o,i;main(){for(;i++<25;)cin>>z,x[z]=i;for(cin>>i;i--;){cin>>z;c|=1<