#include // #include // NOTE: AtCoderライブラリ using namespace std; // using namespace atcoder; // NOTE: AtCoderライブラリ #define fi first #define se second #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; i--) #define dbg(x) cerr << #x << ": " << x << endl; #define dbg2(x, y) cerr << #x << ": " << x << ", " << #y << ": " << y << endl; #define dbg3(x, y, z) cerr << #x << ": " << x << ", " << #y << ": " << y << ", " << #z << ": " << z << endl; #define nl() cout << "========================================" << endl; #define yn { puts("Yes"); } else{ puts("No"); } // 使い方: if (条件) yn; typedef long long ll; typedef long double ld; typedef pair pii; typedef pair pll; typedef vector vi; typedef vector vl; typedef vector vb; typedef vector vc; typedef vector vs; typedef vector> vvi; typedef vector> vvl; typedef vector> vvb; typedef vector> vvc; typedef vector> vpii; typedef vector> vpll; const long long LINF = 1001002003004005006ll; const int INF = 1001001001; template void chmin(T &a, T b) { if (a > b) a = b; } template void chmax(T &a, T b) { if (a < b) a = b; } int main() { int N; cin >> N; string S, T; cin >> S >> T; set diff; rep(i, N) { if (S[i] != T[i]) diff.insert(i); } int Q; cin >> Q; rep(i, Q) { string C; cin >> C; int X; cin >> X; char Y; cin >> Y; X--; if (C == "S") S[X] = Y; else T[X] = Y; if (S[X] == T[X]) { if (diff.count(X) != 0) diff.erase(X); } else { if (diff.count(X) == 0) diff.insert(X); } if (diff.size() == 0) { cout << "=" << endl; } else { int i = *diff.begin(); if (S[i] > T[i]) { cout << ">" << endl; } else { cout << "<" << endl; } } } }