import java.io.PrintWriter import java.util.* fun PrintWriter.solve() { val n = nextInt() var s = next().toCharArray() var t = next().toCharArray() var pq = PriorityQueue() for (i in 0 until n) if (s[i] != t[i]) pq.add(i) val q = nextInt() val ans = Array(q) { "" } for(i in 0 until q) { val c = next() val x = nextInt() - 1 if (c == "S") s[x] = ('0' + nextInt()).toChar() else t[x] = ('0' + nextInt()).toChar() if (s[x] != t[x]) pq.add(x) while (pq.isNotEmpty() && s[pq.peek()] == t[pq.peek()]) pq.remove() if (pq.isEmpty()) ans[i] = "=" else { val k = pq.peek() if (s[k] < t[k]) ans[i] = "<" else ans[i] = ">" } } println(ans.joinToString("\n")) } fun main() { val writer = PrintWriter(System.out, false) writer.solve() writer.flush() } // region Scanner private var st = StringTokenizer("") private val br = System.`in`.bufferedReader() fun next(): String { while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine()) return st.nextToken() } fun nextInt() = next().toInt() fun nextLong() = next().toLong() fun nextLine() = br.readLine()!! fun nextDouble() = next().toDouble() // endregion