def segfunc(x,y): return x+y class SegmentTree(object): def __init__(self, A, dot, unit): n = 1 << (len(A) - 1).bit_length() tree = [unit] * (2 * n) for i, v in enumerate(A): tree[i + n] = v for i in range(n - 1, 0, -1): tree[i] = dot(tree[i << 1], tree[i << 1 | 1]) self._n = n self._tree = tree self._dot = dot self._unit = unit def __getitem__(self, i): return self._tree[i + self._n] def update(self, i, v): i += self._n self._tree[i] = v while i != 1: i >>= 1 self._tree[i] = self._dot(self._tree[i << 1], self._tree[i << 1 | 1]) def add(self, i, v): self.update(i, self[i] + v) def sum(self, l, r): #これで[l,r)から取り出す。 l += self._n r += self._n l_val = r_val = self._unit while l < r: if l & 1: l_val = self._dot(l_val, self._tree[l]) l += 1 if r & 1: r -= 1 r_val = self._dot(self._tree[r], r_val) l >>= 1 r >>= 1 return self._dot(l_val, r_val) N = int(input()) S = str(input()); S = [int(s) for s in S] #大きい1 T = str(input()); T = [int(t) for t in T] #大きい2 Tree = SegmentTree([0]*(N+1),segfunc,0) for i in range(N): keta = i+1 if S[i] > T[i]: Tree.update(keta,1) elif T[i] > S[i]: Tree.update(keta,2) Q = int(input()) for _ in range(Q): Flag, x, y = input().split() x = int(x) - 1 #0index y = int(y) if Flag == "S": S[x] = y else: T[x] = y #print(S,T) if S[x] > T[x]: Tree.update(x+1,1) elif T[x] > S[x]: Tree.update(x+1,2) else: Tree.update(x+1,0) if Tree.sum(0,N+2) == 0: print("=") else: ok = 1 ng = N while abs(ok-ng) > 1: mid = (ok+ng)//2 if Tree.sum(0,mid) == 0: ok = mid else: ng = mid #print(ok,Tree.__getitem__(ok)) if Tree.__getitem__(ok) == 1: print(">") else: print("<")