import sys import heapq hpush = heapq.heappush hpop = heapq.heappop input = sys.stdin.readline N = int(input()) S = list(map(int, list(input())[: -1])) T = list(map(int, list(input())[: -1])) h = [] for i in range(N): if S[i] != T[i]: hpush(h, i) for _ in range(int(input())): c, x, y = input().split() x = int(x) - 1 y = int(y) if c == "S": S[x] = y if c == "T": T[x] = y if S[x] != T[x]: hpush(h, x) while len(h) and S[h[0]] == T[h[0]]: hpop(h) if len(h): i = h[0] if S[i] > T[i]: print(">") if S[i] < T[i]: print("<") else: print("=")