#include using namespace std; using Int = long long; 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<>p>>q>>a; if(p<=q&&a>0) drop(MAX); if(p>=q&&a==0) drop(0); Int l=0,r=MAX; while(l+1>1; if(check(m)) l=m; else r=m; } const Int LEN=1e8; Int pos=l-LEN; chmax(pos,1); for(Int i=1;i