#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); int n; string s, t; cin >> n >> s >> t; set diff; rep(i, n) if (s[i] != t[i]) diff.insert(i); int q; cin >> q; while (q--) { char c; int x, y; cin >> c >> x >> y; --x; if (s[x] != t[x]) diff.erase(x); if (c == 'S') s[x] = y + '0'; if (c == 'T') t[x] = y + '0'; if (s[x] != t[x]) diff.insert(x); if (diff.empty()) { cout << '=' << '\n'; } else { int i = *diff.begin(); assert(s[i] != t[i]); cout << (s[i] < t[i] ? '<' : '>') << '\n'; } } return 0; }