def judge_which_larger( compare: list[str], init_digit: int = 1) -> tuple[str, int]: for digit, mark in enumerate(compare[init_digit-1:], init_digit): if mark == "=": continue return mark, digit return "=", digit def main(): _ = input() S = list(map(int, str(input()))) T = list(map(int, str(input()))) S_T_compare = [] for s_num, t_num in zip(S, T): if s_num > t_num: S_T_compare.append(">") elif s_num == t_num: S_T_compare.append("=") else: S_T_compare.append("<") current_status, diff_digit = judge_which_larger(S_T_compare) for _ in range(int(input())): which_num, digit, number = input().split() digit = int(digit) number = int(number) if which_num == "S": S[digit-1] = number elif which_num == "T": T[digit-1] = number else: raise ValueError if S[digit-1] > T[digit-1]: S_T_compare[digit-1] = ">" elif S[digit-1] == T[digit-1]: S_T_compare[digit-1] = "=" else: S_T_compare[digit-1] = "<" if diff_digit < digit: print(current_status) elif diff_digit > digit: if S_T_compare[digit-1] == "=": print(current_status) else: print(S_T_compare[digit-1]) current_status = S_T_compare[digit-1] diff_digit = digit else: current_status, diff_digit = judge_which_larger( S_T_compare, diff_digit) print(current_status) if __name__ == "__main__": main()