from heapq import heappop, heappush n = int(input()) s = list(map(int, list(input()))) t = list(map(int, list(input()))) q = int(input()) s_bigger = [] s_bigger_del = [] t_bigger = [] t_bigger_del = [] for i in range(n): if s[i] > t[i]: heappush(s_bigger, i * 10 + s[i]) elif s[i] < t[i]: heappush(t_bigger, i * 10 + t[i]) for _ in range(q): # delのものを消す # while s_bigger_del: # if s_bigger[0] == s_bigger_del[0]: # heappop(s_bigger) # heappop(s_bigger_del) # else: # break # while t_bigger_del: # if t_bigger[0] == t_bigger_del[0]: # heappop(t_bigger) # heappop(t_bigger_del) # else: # break c, x, y = input().split() x = int(x) y = int(y) if c == "S": if s[x - 1] > t[x - 1]: heappush(s_bigger_del, (x - 1) * 10 + s[x - 1]) elif s[x - 1] < t[x - 1]: heappush(t_bigger_del, (x - 1) * 10 + t[x - 1]) s[x - 1] = y if s[x - 1] > t[x - 1]: heappush(s_bigger, (x - 1) * 10 + s[x - 1]) elif t[x - 1] > s[x - 1]: heappush(t_bigger, (x - 1) * 10 + t[x - 1]) else: if s[x - 1] > t[x - 1]: heappush(s_bigger_del, (x - 1) * 10 + s[x - 1]) elif s[x - 1] < t[x - 1]: heappush(t_bigger_del, (x - 1) * 10 + t[x - 1]) t[x - 1] = y if s[x - 1] > t[x - 1]: heappush(s_bigger, (x - 1) * 10 + s[x - 1]) elif t[x - 1] > s[x - 1]: heappush(t_bigger, (x - 1) * 10 + t[x - 1]) while s_bigger_del: if s_bigger[0] == s_bigger_del[0]: heappop(s_bigger) heappop(s_bigger_del) else: break while t_bigger_del: if t_bigger[0] == t_bigger_del[0]: heappop(t_bigger) heappop(t_bigger_del) else: break if not s_bigger and not t_bigger: print("=") elif not s_bigger: print("<") elif not t_bigger: print(">") else: ttt = t_bigger[0] // 10 sss = s_bigger[0] // 10 if sss < ttt: print(">") else: print("<") # print("s", "".join(map(str, s))) # print("t", "".join(map(str, t))) # print("s", s_bigger, s_bigger_del) # print("t", t_bigger, t_bigger_del)