import java.io.PrintWriter; import java.util.Scanner; import java.util.TreeSet; public class P5533 { static Scanner in = new Scanner(System.in); static PrintWriter out = new PrintWriter(System.out); public static void main(String[] args) { int n = ni(); char[] s = in.next().toCharArray(); char[] t = in.next().toCharArray(); TreeSet sg = new TreeSet<>(); TreeSet tg = new TreeSet<>(); for(int i = 0;i < n;i++){ if(s[i] > t[i]){ sg.add(i); }else if(s[i] < t[i]){ tg.add(i); } } for(int Q = ni();Q > 0;Q--){ char c = in.next().charAt(0); int k = ni()-1; int v = ni(); if(c == 'S'){ s[k] = (char)('0'+v); }else{ t[k] = (char)('0'+v); } sg.remove(k); tg.remove(k); if(s[k] > t[k]){ sg.add(k); }else if(s[k] < t[k]){ tg.add(k); } int mins = sg.isEmpty() ? n + 1 : sg.first(); int mint = tg.isEmpty() ? n + 1 : tg.first(); if(mins == mint){ out.println("="); }else if(mins < mint) { out.println(">"); }else{ out.println("<"); } } out.flush(); } static int ni(){ return Integer.parseInt(in.next()); } }