N = int(input()) S = list(str(input())) T = list(str(input())) Q = int(input()) A = set() for i in range(N): if S[i] != T[i]: A.add(i) # print(A) # l = list(">>>>>>><>>>>>>>>><<<") ansList = [] for _ in range(Q): c,x,y = map(str,input().split()) x = int(x)-1 if c == 'T': T[x] = y else: S[x] = y if S[x] != T[x]: A.add(x) else: if x in A: A.remove(x) if A == set(): ansList.append('=') continue # print(A) a = list(A)[0] ans = '' if S[a] > T[a]: ans = '>' elif S[a] < T[a]: ans = '<' else: ans = '=' ansList.append(ans) # b = ans == l[_] # print(b,_) for ans in ansList: print(ans)