#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
using mint = modint998244353;

int main() {
  int N; cin >> N;
  string S, T; cin >> S >> T;
  set<int> st;
  for (int i = 0; i < N; i++) {
    if (S[i] != T[i]) st.insert(i);
  }
  int Q; cin >> Q;
  while (Q--) {
    char c, y; int x; cin >> c >> x >> y;
    if (c == 'S') {
      S[x - 1] = y;
    } else {
      T[x - 1] = y;
    }
    if (S[x - 1] != T[x - 1]) st.insert(x - 1);
    else st.erase(x - 1);
    if (S[*st.begin()] > T[*st.begin()]) cout << '>' << endl;
    else if (S[*st.begin()] < T[*st.begin()]) cout << '<' << endl;
    else cout << '=' << endl;
  }
  return 0;
}