// #include using namespace std; #define fi first #define se second #define all(x) x.begin(), x.end() #define lch (o << 1) #define rch (o << 1 | 1) typedef double db; typedef long long ll; typedef unsigned int ui; typedef pair pint; typedef tuple tint; const int N = 2e5 + 5; const int BASE = 299213; const int MOD = 929292929; const int INF = 0x3f3f3f3f; const ll INF_LL = 0x3f3f3f3f3f3f3f3f; struct BITree { ll t[N]; int lowbit(int x) { return x & -x; } void add(int x, ll val) { for (; x < N; x += lowbit(x)) t[x] = (t[x] + val) % MOD; } ll query(int x) { ll ret = 0; for (; x; x -= lowbit(x)) ret += t[x]; return (ret % MOD + MOD) % MOD; } }; BITree bt1, bt2; string a, b; ll pbas[N]; int main() { ios::sync_with_stdio(0); pbas[0] = 1; for (int i = 1; i < N; i++) pbas[i] = 1LL * pbas[i - 1] * BASE % MOD; int n; cin >> n; cin >> a >> b; a = ' ' + a; b = ' ' + b; for (int i = 1; i <= n; i++) { bt1.add(i, (a[i] - '0') * pbas[i]); bt2.add(i, (b[i] - '0') * pbas[i]); } auto lcp = [&]() { int L = 1, R = n + 1; while (L < R) { int M = (L + R) / 2; if (bt1.query(M) == bt2.query(M)) L = M + 1; else R = M; } return L; }; int q; cin >> q; while (q--) { char op; int x, y; cin >> op >> x >> y; BITree &bt = op == 'S' ? bt1 : bt2; string &s = op == 'S' ? a : b; bt.add(x, -(s[x] - '0') * pbas[x]); s[x] = y + '0'; bt.add(x, (s[x] - '0') * pbas[x]); int len = lcp(); if (len == n + 1) { cout << "=" << endl; } else { cout << (a[len] < b[len] ? "<" : ">") << endl; } } return 0; }