from heapq import heappop, heappush n = int(input()) S = list(map(int, list(input()))) T = list(map(int, list(input()))) op_idx = n Heap = [] different_num_set = set() for i in range(n): if S[i] != T[i]: heappush(Heap, i) different_num_set.add(i) q = int(input()) for _ in range(q): c, x, y = input().split() x = int(x) y = int(y) x -= 1 pre_same = S[x] == T[x] if c == 'S': S[x] = y elif c == 'T': T[x] = y curr_same = S[x] == T[x] if curr_same != pre_same: if pre_same: heappush(Heap, x) different_num_set.add(x) else: different_num_set.remove(x) while Heap and Heap[0] not in different_num_set: heappop(Heap) if len(Heap) == 0: print('=') continue d = Heap[0] if S[d] > T[d]: print('>') elif S[d] < T[d]: print('<')