#include using namespace std; const int maxi=1e5+5; const int bl=200; #define pb push_back int n,m; int s[maxi],d[maxi]; char t[maxi]; int a[maxi],b[maxi]; int rez[maxi],dp[maxi]; int ma[maxi],mb[maxi],wa[maxi],wb[maxi]; pair< pair, int> par[maxi]; int tot; void ocisti() { for (int i=0;i>tc; while(tc--) { scanf("%d%d",&m,&n); for (int i=1;i<=n;i++) scanf(" %c",&t[i]); for (int i=1;i<=n;i++) scanf("%d",&s[i]); for (int i=1;i<=n;i++) scanf("%d",&d[i]); ocisti(); for (int i=1;i<=n;i++) if (d[i]>s[i]) { tot++; if (t[i]=='E' || t[i]=='C') par[tot]={{d[i],s[i]},0}; else par[tot]={{d[i],s[i]},1}; } solve(); for (int i=1;i<=n;i++) printf("%d ",rez[i]); printf("\n"); } return 0; } //MENI OVO LAKSE OD LAZY PROPAGATIONA