#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main(){

    int N, Q, x, y;
    char c;
    string S, T;
    cin >> N >> S >> T >> Q;
    set<int> sts, stl;
    for (int i=0; i<N; i++){
        if (S[i] < T[i]) sts.insert(i);
        else if (S[i] > T[i]) stl.insert(i);
    }
    
    while(Q){
        Q--;
        cin >> c >> x >> y; x--;
        sts.erase(x);
        stl.erase(x);
        if (c == 'S') S[x] = y+'0';
        else T[x] = y+'0';

        if (S[x] > T[x]) stl.insert(x);
        else if (S[x] < T[x]) sts.insert(x);
        
        if (sts.size() == 0){
            cout << (stl.size() == 0 ? "=" : ">") << endl;
            continue;
        }
        else if (stl.size() == 0){
            cout << (sts.size() == 0 ? "=" : "<") << endl;
            continue;
        }

        x = *sts.begin();
        y = *stl.begin();
        cout << (x < y ? "<" : ">") << endl;
    }

    return 0;
}