#pragma GCC diagnostic warning "-Wextra" #pragma GCC diagnostic warning "-Wshadow" #include using namespace std; template bool cmin(A& a, B b) { return a > b && (a = b, true); } template bool cmax(A& a, B b) { return a < b && (a = b, true); } template ostream& operator<<(ostream& os, pair& p) { return os << '(' << p.first << ", " << p.second << ')'; } static bool debug = false; void dump() {} template void dump(A&& a, B&&... b) { if (debug) cout << a << (sizeof...(b) ? ' ' : '\n'), dump(b...); } template void dump1D(A& a) { if (debug) for (auto i = a.begin(); i != a.end(); i++) cout << *i << (next(i) != a.end() ? ' ' : '\n'); } template void dump2D(A& a) { if (debug) for (auto i = a.begin(); i != a.end(); i++) dump1D(*i), cout << (next(i) != a.end() ? "" : "\n"); } signed main() { cin.tie(nullptr)->sync_with_stdio(false); debug = true; int N; cin >> N; string S, T; cin >> S >> T; int Q; cin >> Q; vector> V(Q); for (int i = 0; i < Q; i++) { char a, c; int b; cin >> a >> b >> c, b--; V.at(i) = {a, b, c}; } map> MA; for (int i = 0; i < N; i++) { if (S.at(i) != T.at(i)) MA[i] = {S.at(i), T.at(i)}; } for (const auto& [a, b, c] : V) { if (a == 'S') S.at(b) = c; else T.at(b) = c; if (MA.count(b)) { if (S.at(b) == T.at(b)) MA.erase(b); else MA[b] = {S.at(b), T.at(b)}; } else { if (S.at(b) != T.at(b)) MA[b] = {S.at(b), T.at(b)}; } if ((int)MA.size() == 0) cout << '=' << '\n'; else { const auto& [a, b] = *MA.begin(); const auto& [c, d] = b; if (c < d) cout << '<' << '\n'; else cout << '>' << '\n'; } } }