# def main():にしよう # まずNはintで受けるのか、文字列で受けるのか # 長さ10**5はintには巨大すぎる # 数字が大きすぎるか # どの桁まで同じかを管理するのでどうだろう def check(LIST1, LIST2, start, N): idx = start-1 for i in range(start, N): if LIST1[i] == LIST2[i]: idx = i elif LIST1[i] > LIST2[i]: return idx, '>' elif LIST1[i] < LIST2[i]: return idx, '<' return N-1, '=' def main(): N = int(input()) S = input() T = input() S_list = list(map(int, S)) T_list = list(map(int, T)) same, ans = check(S_list, T_list, 0, N) Q = int(input()) for i in range(Q): query = list(map(str, input().split())) d = int(query[1])-1 new = int(query[2]) if d <= same+1: if query[0] == 'S': S_list[d] = new elif query[0] == 'T': T_list[d] = new same, ans = check(S_list, T_list, d, N) print(ans) elif d > same+1: if query[0] == 'S': S_list[d] = new elif query[0] == 'T': T_list[d] = new print(ans) main()