#include using namespace std; typedef long long ll; typedef vector vi; typedef vector vl; typedef complex P; typedef pair pii; #define REP(i,n) for(ll i=0;i> x >> t; if(x==10){ ok = true; fin += (j+'0'); break; } if(cl == -1){ cl = x; cand = fin; cand += (j+'0'); }else if(x > cl){ cl = x; fin += (j+'0'); break; }else if(x < cl){ fin = cand; break; } } if(ok)break; } return 0; }