mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline class Bit: def __init__(self, n): self.size = n self.tree = [0] * (n + 1) def sum(self, i): s = 0 while i > 0: s += self.tree[i] i -= i & -i return s def add(self, i, x): while i <= self.size: self.tree[i] += x i += i & -i def lower_bound(self, w): if w <= 0: return 0 x = 0 k = 1 << (self.size.bit_length() - 1) while k: if x + k <= self.size and self.tree[x + k] < w: w -= self.tree[x + k] x += k k >>= 1 return x + 1 N = int(input()) S = input().rstrip('\n') T = input().rstrip('\n') S = [s for s in S] T = [t for t in T] bit_S = Bit(N) bit_T = Bit(N) for i in range(N): s = int(S[i]) t = int(T[i]) if s > t: bit_S.add(i+1, 1) elif s < t: bit_T.add(i+1, 1) for _ in range(int(input())): c, x, y = input().split() x = int(x) S_large = 0 s = int(S[x - 1]) t = int(T[x - 1]) if s > t: S_large = 1 elif s < t: S_large = -1 if c == "S": S[x-1] = y else: T[x-1] = y s = int(S[x-1]) t = int(T[x-1]) if s > t: if S_large == 1: pass elif S_large == 0: bit_S.add(x, 1) else: bit_S.add(x, 1) bit_T.add(x, -1) elif s < t: if S_large == 1: bit_T.add(x, 1) bit_S.add(x, -1) elif S_large == 0: bit_T.add(x, 1) else: pass else: if S_large == 1: bit_S.add(x, -1) elif S_large == 0: pass else: bit_T.add(x, -1) js = bit_S.lower_bound(1) jt = bit_T.lower_bound(1) if js < jt: print(">") elif js > jt: print("<") else: print("=") if __name__ == '__main__': main()