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(); int compare = 0; int col = 0; for (int i = 0; i < n; i++) { if (s[i] == t[i]) { continue; } compare = s[i] - t[i]; col = i; break; } if (compare == 0) { col = n; } 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 (col >= c) { for (int j = c; j < n; j++) { if (s[j] == t[j]) { continue; } compare = s[j] - t[j]; col = j; break; } } if (compare == 0) { col = n; } if (compare == 0) { sb.append("="); } else if (compare < 0) { sb.append("<"); } else { sb.append(">"); } sb.append("\n"); } System.out.print(sb); } }