# まずNはintで受けるのか、文字列で受けるのか # 長さ10**5はintには巨大すぎるか N = int(input()) S = input() T = input() #print(S, T) # eval('015')はできないみたいよ Q = int(input()) for i in range(Q): query = list(map(str, input().split())) if query[0] == 'S': d = int(query[1])-1 S = S[:d]+query[2]+S[d+1:] elif query[0] == 'T': d = int(query[1])-1 T = T[:d]+query[2]+T[d+1:] evalS = eval(S.lstrip('0')) evalT = eval(T.lstrip('0')) if evalS > evalT: print('>') elif evalS < evalT: print('<') elif evalS == evalT: print('=') #print('S', evalS, 'T', evalT)