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(">>>>>>><>>>>>>>>><<<") 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(): print('=') continue # print(A) a = list(A)[0] ans = '' if S[a] > T[a]: ans = '>' elif S[a] < T[a]: ans = '<' else: ans = '=' print(ans) # b = ans == l[_] # print(b)