#include #include #include #include #include #define LL long long #define Re register int using namespace std; const int N=12e5+3; int T,ans,mask;char op[10],s[N]; inline void in(Re &x){ int f=0;x=0;char c=getchar(); while(c<'0'||c>'9')f|=c=='-',c=getchar(); while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+(c^48),c=getchar(); x=f?-x:x; } inline string In(Re mask){ scanf("%s",s);string chars=s; for(int j=0;j