# def main():にしよう # まずNはintで受けるのか、文字列で受けるのか # 長さ10**5はintには巨大すぎる # 数字が大きすぎるか # どの桁まで同じかを管理するのでどうだろう from sys import stdin readline = stdin.readline def check(LIST1, LIST2, start, N): idx = start-1 for i in range(start, N): if int(LIST1[i]) == int(LIST2[i]): idx = i elif int(LIST1[i]) > int(LIST2[i]): return idx, '>' elif int(LIST1[i]) < int(LIST2[i]): return idx, '<' return N-1, '=' def main(): N = int(readline()) S_list = list(readline()[:-1]) #最後は改行 T_list = list(readline()[:-1]) #最後は改行 same, ans = check(S_list, T_list, 0, N) Q = int(readline()) for i in range(Q): query = list(map(str, readline().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) if __name__ == '__main__': main()