#include using namespace std; using Int = long long; const char newl = '\n'; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a void drop(const T &x){cout< vector read(size_t n){ vector ts(n); for(size_t i=0;i>ts[i]; return ts; } template struct SegmentTree{ using F = function; int n; F f; T ti; vector dat; SegmentTree(F f,T ti):f(f),ti(ti){} void init(int n_){ n=1; while(n &v){ int n_=v.size(); init(n_); for(int i=0;i>=1) dat[k]=f(dat[(k<<1)|0],dat[(k<<1)|1]); } T query(int a,int b){ if(a>=b) return ti; T vl=ti,vr=ti; for(int l=a+n,r=b+n;l>=1,r>>=1) { if(l&1) vl=f(vl,dat[l++]); if(r&1) vr=f(dat[--r],vr); } return f(vl,vr); } template int max_right(int s,C &check,T &acc,int k,int l,int r){ if(l+1==r){ acc=f(acc,dat[k]); return check(acc)?-1:k-n; } int m=(l+r)>>1; if(m<=s) return max_right(s,check,acc,(k<<1)|1,m,r); if(s<=l and check(f(acc,dat[k]))){ acc=f(acc,dat[k]); return -1; } int vl=max_right(s,check,acc,(k<<1)|0,l,m); if(~vl) return vl; return max_right(s,check,acc,(k<<1)|1,m,r); } // max t s.t. check(query(s,t)) // O(\log N) template int max_right(int s,C &check){ assert(s>n; string s,t; cin>>s>>t; auto calc=[&](char a,char b){ if(a==b) return 0; if(ab) return +1; abort(); }; auto f=[&](int a,int b){return a?a:b;}; SegmentTree seg(f,0); vector vs(n); for(int i=0;i>q; for(int i=0;i>c>>x>>y; x--; if(c=="S") s[x]=y+'0'; if(c=="T") t[x]=y+'0'; seg.set_val(x,calc(s[x],t[x])); if(seg.query(0,n)==0){ cout<<"="<")<