import sys readline = sys.stdin.readline from heapq import * class QuasiBinaryTree: def __init__(self, rule="min"): if rule == "max": self.pm = -1 else: self.pm = 1 self.inf = 10**18 self.P = [self.inf] self.Q = [] def insert(self, x): heappush(self.P, x * self.pm) def erase(self, x): heappush(self.Q, x * self.pm) def top(self): while self.Q and (self.P[0] == self.Q[0]): heappop(self.P) heappop(self.Q) return self.P[0] * self.pm N = int(readline()) S = list(input().rstrip()) T = list(input().rstrip()) S = list(map(int, S)) T = list(map(int, T)) BT = QuasiBinaryTree("min") BT.insert(N) for i in range(N): if S[i] != T[i]: BT.insert(i) Q = int(readline()) for _ in range(Q): c, x, y = readline().split() x = int(x) - 1 y = int(y) pre = int(S[x] == T[x]) if c == "S": S[x] = y else: T[x] = y now = int(S[x] == T[x]) if pre != now: if now: BT.erase(x) else: BT.insert(x) ind = BT.top() if ind == N: print("=") elif S[ind] > T[ind]: print(">") else: print("<")