import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); char[] s = sc.next().toCharArray(); char[] t = sc.next().toCharArray(); TreeSet diff = new TreeSet<>(); for (int i = 0; i < n; i++) { if (s[i] != t[i]) { diff.add(i); } } int q = sc.nextInt(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < q; i++) { char type = sc.next().charAt(0); int c = sc.nextInt() - 1; char x = sc.next().charAt(0); if (type == 'T') { t[c] = x; } else { s[c] = x; } if (t[c] == s[c]) { diff.remove(c); } else { diff.add(c); } if (diff.size() == 0) { sb.append("="); } else if (s[diff.first()] < t[diff.first()]) { sb.append("<"); } else { sb.append(">"); } sb.append("\n"); } System.out.print(sb); } }