#include using namespace std; typedef long long int ll; typedef pair P; typedef vector VI; typedef vector VVI; #define REP(i,n) for(int i=0;i<(n);i++) #define ALL(v) v.begin(),v.end() constexpr ll MOD=998244353; constexpr ll INF=2e18; int main(){ int n; cin >> n; string s, t; cin >> s >> t; int q; cin >> q; set st; REP(i,n){ if(s[i]!=t[i]) st.insert(i); } char c; int x, y; while(q--){ cin >> c >> x >> y; x--; if(c=='S'){ if(s[x]!=t[x]){ s[x]=(char)('0'+y); if(s[x]==t[x]) st.erase(x); } else{ s[x]=(char)('0'+y); if(s[x]!=t[x]) st.insert(x); } } else{ if(s[x]!=t[x]){ t[x]=(char)('0'+y); if(s[x]==t[x]) st.erase(x); } else{ t[x]=(char)('0'+y); if(s[x]!=t[x]) st.insert(x); } } if(st.empty()) cout << "=" << endl; else if(s[*st.begin()]>t[*st.begin()]) cout << ">" << endl; else cout << "<" << endl; } return 0; }