import heapq import collections N = int(input()) S = list(map(int, list(input()))) T = list(map(int, list(input()))) Q = int(input()) que = collections.deque() pq = [] heapq.heapify(pq) for i, (s, t) in enumerate(zip(S, T)): if s != t: heapq.heappush(pq, i) 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 if S[s] != T[s]: heapq.heappush(pq, s) tmp = "=" while pq: cur = heapq.heappop(pq) if S[cur] > T[cur]: tmp = ">" heapq.heappush(pq, cur) break elif S[cur] == T[cur]: continue elif S[cur] < T[cur]: tmp = "<" heapq.heappush(pq, cur) break que.append(tmp) while que: print(que.popleft())