# 文字列で受ける # 最初の数字か最初の差を記録して、それから数を更新していく N = int(input()) S = input() T = input() S_list = list(map(int, S)) T_list = list(map(int, T)) S_num = eval(S.lstrip('0')) T_num = eval(T.lstrip('0')) Q = int(input()) for i in range(Q): query = list(map(str, input().split())) d = int(query[1])-1 new = int(query[2]) if query[0] == 'S': S_num += (new - S_list[d])*10**(N-1-d) S_list[d] = new elif query[0] == 'T': T_num += (new - T_list[d])*10**(N-1-d) T_list[d] = new if S_num > T_num: print('>') elif S_num < T_num: print('<') elif S_num == T_num: print('=') #print('S_num', S_num, 'T_num', T_num)