def judge_which_larger(compare: list[str]) -> str: for mark in compare: if mark == "=": continue return mark return "=" 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("<") 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] = "<" print(judge_which_larger(S_T_compare)) if __name__ == "__main__": main()