Heaph; { int@n; string@s,@t; int@q; h.walloc(n+q); h.push(0..n-1); rep(q){ char@c; int@x,@y; (c&1?s:t)[--x]=y+48; h.push(x); while(1){ int j=h.top(); if(s[j]!=t[j]){ wt(s[j]"); break; } h.pop(); if(!h.size){ wt("="); break; } } } }