class FenwickTree(): def __init__(self, n): self.n = n self.data = [0] * n def build(self, arr): #assert len(arr) <= n for i, a in enumerate(arr): self.data[i] = a for i in range(1, self.n + 1): if i + (i & -i) <= self.n: self.data[i + (i & -i) - 1] += self.data[i - 1] def add(self, p, x): #assert 0 <= p < self.n p += 1 while p <= self.n: self.data[p - 1] += x p += p & -p def sum(self, r): #assert 0 <= r <= self.n s = 0 while r: s += self.data[r - 1] r -= r & -r return s def get(self, p): return self.range_sum(p, p + 1) def range_sum(self, l, r): #assert 0 <= l <= r <= self.n return self.sum(r) - self.sum(l) #not verified def bisect_left(self, x): if x <= 0: return 0 res = 0 k = 1 << self.n.bit_length() while k: if res + k <= self.n and self.data[res + k - 1] < x: x -= self.data[res + k - 1] res += k k >>= 1 return res + 1 class OrderedSet(): #0以上n未満の整数の集合を管理する(重複なし) def __init__(self, n): self.n = n self.bit = FenwickTree(n) def build(self, arr): self.bit.build(arr) def is_exist(self, k): return self.bit.get(k) def size(self): return self.bit.sum(self.n) def insert(self, k): if self.is_exist(k): return 0 self.bit.add(k, 1) return 1 def delete(self, k): if not self.is_exist(k): return 0 self.bit.add(k, -1) return 1 def get(self, i): sz = self.size() if sz <= i or i + sz < 0: return -1 if i < 0: return self.get(sz + i) ret = self.bit.bisect_left(i + 1) - 1 return ret def max(self): return self.get(-1) def min(self): return self.get(0) def index(self, k): if not self.is_exist(k): return -1 ret = self.bit.sum(k) return ret def predecessor(self, k): ret = self.bit.bisect_left(self.bit.sum(k + 1)) - 1 return ret def successor(self, k): ret = self.bit.bisect_left(self.bit.sum(k) + 1) - 1 return ret if ret != self.n else -1 import sys input = sys.stdin.readline N = int(input()) S = list(input()) T = list(input()) P = OrderedSet(N + 1) P.insert(N) for i in range(N): if S[i] != T[i]: P.insert(i) Q = int(input()) for _ in range(Q): c, x, y = input().split() x = int(x) - 1 if c == 'S': if S[x] == T[x]: if T[x] != y: P.delete(x) else: if T[x] == y: P.insert(x) S[x] = y else: if S[x] == T[x]: if S[x] == y: P.delete(x) else: if S[x] == y: P.insert(x) T[x] = y v = P.min() if v == N: print('=') else: if S[v] > T[v]: print('>') else: print('<')