#include using namespace std; #include #include #include #include #include template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } #define rep(i,n) for (int i = 0; i < (n); ++i) typedef long long ll; using P=pair; const int INF=1001001001; const int mod=1e9+7; int main(){ int n,Q; string s,t; cin>>n>>s>>t>>Q; priority_queue,greater>q; rep(i,n){ if(s[i]=='0'&&t[i]=='0'||s[i]==t[i]){continue;} q.push(i); } rep(i,Q){ char c,y; int x; cin>>c>>x>>y; x--; if(c=='S'){s[x]=y;} else{t[x]=y;} if(y!='0'||s[x]!=t[x]){q.push(x);} while(!q.empty()&&s[q.top()]==t[q.top()]){q.pop();} if(q.empty()){cout<<'='<'<