import sys import io, os input = sys.stdin.readline #input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline n = int(input()) s = int(input()) t = int(input()) S = list(str(s)) T = list(str(t)) S = [int(c) for c in S] T = [int(c) for c in T] S = [0]*(n-len(S))+S T = [0]*(n-len(T))+T for i in range(n): if S[i] != T[i]: p = i break else: p = n #print(S) #print(T) #N = 2*10**5+50 #table = [0]*(N+1) #table[0] = 1 #for i in range(1, N+1): #table[i] = table[i-1]*10 q = int(input()) for i in range(q): c, x, y = map(str, input().rstrip().split()) #print(c, x, y) x, y = int(x), int(y) x -= 1 if c == 'S': S[x] = y else: T[x] = y if x < p: p = x if S[x] > T[x]: print('>') elif S[x] == T[x]: print('=') else: print('<') else: if S[p] == T[p]: for j in range(p, n): if S[j] != T[j]: p = j break else: p = n if p != n: if S[p] > T[p]: print('>') else: print('<') else: print('=') #print(p) #print(S) #print(T)