class Fenwick: def __init__(self, n): self.n = n self.data = [0] * (n + 1) self.depth = n.bit_length() def getsum(self, i): # 0-indexed [0: i) res = 0 while i > 0: res += self.data[i] i -= i & -i return res def add(self, i, x): # 0-indexed i += 1 while i <= self.n: self.data[i] += x i += i & -i N = int(input()) S = list(input()) T = list(input()) BIT = Fenwick(N) for i in range(N): if S[i] != T[i]: BIT.add(i, 1) Q = int(input()) for i in range(Q): c, x, y = input().split() x = int(x) - 1 if c == "S": if S[x] == T[x]: S[x] = y if S[x] != T[x]: BIT.add(x, 1) else: S[x] = y if S[x] == T[x]: BIT.add(x, -1) else: if S[x] == T[x]: T[x] = y if S[x] != T[x]: BIT.add(x, 1) else: T[x] = y if S[x] == T[x]: BIT.add(x, -1) st = 0 en = N + 1 while en - st > 1: mid = (en + st) // 2 if BIT.getsum(mid) > 0: en = mid else: st = mid if en == N + 1: print("=") else: if S[en - 1] > T[en - 1]: print(">") else: print("<")