import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.TreeSet; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); char[] s = br.readLine().toCharArray(); char[] t = br.readLine().toCharArray(); TreeSet sets = new TreeSet<>(); TreeSet sett = new TreeSet<>(); for (int i = 0; i < n; i++) { if (s[i] > t[i]) { sets.add(i); } if (s[i] < t[i]) { sett.add(i); } } sets.add(n); sett.add(n); int q = Integer.parseInt(br.readLine()); PrintWriter pw = new PrintWriter(System.out); for (int i = 0; i < q; i++) { String[] sa = br.readLine().split(" "); int x = Integer.parseInt(sa[1]) - 1; if (sa[0].equals("S")) { s[x] = sa[2].charAt(0); } else { t[x] = sa[2].charAt(0); } if (s[x] > t[x]) { sets.add(x); } else { sets.remove(x); } if (s[x] < t[x]) { sett.add(x); } else { sett.remove(x); } int s1 = sets.first(); int t1 = sett.first(); if (s1 == t1) { pw.println("="); } else if (s1 < t1) { pw.println(">"); } else { pw.println("<"); } } pw.flush(); br.close(); } }