import sys input = lambda: sys.stdin.readline().rstrip() n = int(input()) S = list(map(int, input())) T = list(map(int, input())) D = [S[i]-T[i] for i in range(n)] status = 'e' checked = 0 for d in D: if d > 0: status = 's' break elif d < 0: status = 't' break else: checked += 1 q = int(input()) Ans = [None]*q for j in range(q): c, x, y = input().split() x, y = int(x), int(y) if c == 'S': df = y-S[x-1] if df: D[x-1] += df S[x-1] = y if status == 'e': checked = x if df > 0: status = 's' else: status = 't' elif status == 's': if checked >= x-1: checked = x-1 for i in range(x-1, n): d = D[i] if d > 0: break elif d < 0: status = 't' break else: checked += 1 if checked == n: status = 'e' else: if checked >= x-1: checked = x-1 for i in range(x-1, n): d = D[i] if d > 0: status = 's' break elif d < 0: break else: checked += 1 if checked == n: status = 'e' else: df = T[x-1]-y if df: D[x-1] += df T[x-1] = y if status == 'e': checked = x if df > 0: status = 's' else: status = 't' elif status == 's': if checked >= x-1: checked = x-1 for i in range(x-1, n): d = D[i] if d > 0: break elif d < 0: status = 't' break else: checked += 1 if checked == n: status = 'e' else: if checked >= x-1: checked = x-1 for i in range(x-1, n): d = D[i] if d > 0: status = 's' break elif d < 0: break else: checked += 1 if checked == n: status = 'e' if status == 's': Ans[j] = '>' elif status == 'e': Ans[j] = '=' else: Ans[j] = '<' print(*Ans, sep = '\n')