#include using namespace atcoder; #include using namespace std; using ll=long long; using ull=unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) int N,Q; string S,T; set G; int main(){ cin>>N>>S>>T>>Q; rep(i,N) if(S[i]!=T[i]) G.insert(i); rep(i,Q){ char c; int x,y; cin>>c>>x>>y; x--; if(S[x]!=T[x]) G.erase(x); if(c=='S') S[x]=y; if(c=='T') T[x]=y; if(S[x]!=T[x]) G.insert(x); if(G.size()==0) printf("=\n"); else{ int p=*G.begin(); if(S[p]\n"); } } return 0; }