#include using namespace std; #define ALL(x) x.begin(),x.end() #define rep(i,n) for(int i=0;i<(n);i++) #define debug(v) cout<<#v<<":";for(auto x:v){cout<bool chmax(T &a,const T &b){if(abool chmin(T &a,const T &b){if(b>n>>m; vector a(n); rep(i,n) cin>>a[i]; string s;cin>>s; int l=0,r=n-1; int lk=1,rk=1; bool f=false; rep(i,m){ if(s[i]=='L'){ if(l==0){ if(l!=r) lk++; } else l--; if(r!=0) r--; }else{ if(r==n-1){ if(l!=r) rk++; } else r++; if(l!=n-1) l++; } } vector ans(n,0); int i; for(i=0;i