import java.util.Scanner; import java.util.TreeSet; public class P5533 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); 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 = in.nextInt();Q > 0;Q--){ char c = in.next().charAt(0); int k = in.nextInt()-1; int v = in.nextInt(); 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){ System.out.println("="); }else if(mins < mint) { System.out.println(">"); }else{ System.out.println("<"); } } } }