#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; int main(){ int n,q; cin>>n>>q; vector A(n); rep(i,n) cin>>A[i]; string s; cin>>s; vector D(q); rep(i,q) cin>>D[i]; vector B(31),C(31); int b=0; int c=(1<<31)-1; for(int i=0;i