use std::collections::BTreeSet; fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let mut s = s.trim().chars().map(|c| c as usize - '0' as usize).collect::>(); let mut t = String::new(); std::io::stdin().read_line(&mut t).ok(); let mut t = t.trim().chars().map(|c| c as usize - '0' as usize).collect::>(); let mut q = String::new(); std::io::stdin().read_line(&mut q).ok(); let q: usize = q.trim().parse().unwrap(); let queries = (0..q).map(|_| { let mut temp = String::new(); std::io::stdin().read_line(&mut temp).ok(); let temp: Vec<&str> = temp.trim().split_whitespace().collect(); (temp[0].chars().nth(0).unwrap(), temp[1].parse::().unwrap()-1, temp[2].parse::().unwrap()) }) .collect::>(); let mut diff_at = BTreeSet::new(); for i in 0..n { if s[i] != t[i] { diff_at.insert(i); } } for &(c, x, y) in queries.iter() { if c == 'S' { s[x] = y; } else { t[x] = y; } if s[x] == t[x] { diff_at.remove(&x); } else { diff_at.insert(x); } if diff_at.is_empty() { println!("="); } else { let idx = *diff_at.iter().nth(0).unwrap(); if s[idx] > t[idx] { println!(">"); } else { println!("<"); } } } }