N=int(input()) S=list(map(int, list(input()))) T=list(map(int, list(input()))) Q=int(input()) import collections que = collections.deque() for q in range(Q): flag, s, v = input().split() s = int(s)-1 v = int(v) if flag == "S": S[s] = v else: T[s] = v tmp = "=" for s, t in zip(S, T): if s > t: tmp = ">" break elif s == t: continue elif s < t: tmp = "<" break que.append(tmp) while que: print(que.popleft())