#include #include #include #include #include #define rep(i, n) for (int i = 0; i < n; i++) #define ll long long #define be(x) x.begin(), x.end() using namespace std; int main() { int n,q; string s,t; cin >> n >> s >> t >> q; rep(i,q){ string c; int x,y; cin >> c >> x >> y; if(c=="S"){ s[x-1] = y; } else{ t[x-1] = y; } ll san = stoll(s); ll tan = stoll(t); if(san>tan) cout <<">"<