import sys input = sys.stdin.readline N = int(input()) S = list(input().rstrip("\n")) T = list(input().rstrip("\n")) Q = int(input()) tigauketa = N for i in range(N): if S[i] != T[i]: tigauketa = i break if S > T: prevans = ">" elif S == T: prevans = "=" else: prevans = "<" for iii in range(Q): c, x, y = input().split() x = int(x) - 1 if c == "S": S[x] = y else: T[x] = y if x <= tigauketa: if S[x] == T[x]: tigauketa = N for i in range(x + 1, N): if S[i] != T[i]: tigauketa = i break if tigauketa == N: prevans = "=" print("=") elif S[tigauketa] > T[tigauketa]: prevnans = ">" print(">") else: prevans = "<" print("<") else: tigauketa = x if S > T: prevans = ">" print(">") elif S == T: prevans = "=" print("=") else: prevans = "<" print("<") else: print(prevans)