#include #include using namespace std; using namespace atcoder; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; //using mint = modint1000000007; //using mint = modint998244353; int main(){ int N; cin >> N; string S, T; cin >> S >> T; set s; s.insert(N); rep(i,S.size()){ if(S[i] != T[i]){ s.insert(i); } } int Q; cin >> Q; rep(q,Q){ string c; int x, y; cin >> c >> x >> y; x--; if(c == "S"){ S[x] = '0' + y; if(S[x] == T[x]){ s.erase(x); }else{ s.insert(x); } }else{ T[x] = '0' + y; if(S[x] == T[x]){ s.erase(x); }else{ s.insert(x); } } int pos = *(s.begin()); if(pos == N) cout << "=" << endl; else{ int sy = S[pos] - '0'; int ty = T[pos] - '0'; if(sy > ty) cout << ">" << endl; else cout << "<" << endl; } } return 0; }