#include using namespace std; //#include //using namespace atcoder; using ll=long long; using Graph=vector>; #define MAX 50 #define MOD 1000000007 #define INF 1000000000 int n=1; vector tree; void update(int x,char y){ x+=n-1; tree[x]=y; while(x>0){ x=(x-1)/2; char a=tree[2*x+1]; char b=tree[2*x+2]; if(a!='='){ tree[x]=a; }else{ tree[x]=b; } } } int main(){ int N; string S,T; cin>>N>>S>>T; while(nT[i]){ update(i,'>'); }else{ update(i,'='); } } int Q; cin>>Q; for(int i=0;i>c>>x>>y; x--; if(c=='S'){ S[x]=y; }else{ T[x]=y; } if(S[x]T[x]){ update(x,'>'); }else{ update(x,'='); } cout<