#include //#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //using namespace atcoder; using namespace std; using ll = long long; #define all(A) A.begin(),A.end() using vll = vector; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) using Graph = vector>>; vector seen; bool C = true; vector dist; ll mod = 998244353; int main() { ll N,Q; string S, T; cin >> N >> S >> T>>Q; rep(q, Q) { char C, Y; ll X; cin >> C >> X >> Y; if (C == 'S') { S[X - 1] = Y; } else { T[X - 1] = Y; } if (S < T)cout << "<" << endl; else if (S == T)cout << "=" << endl; else cout << ">" << endl; } }