struct Q{ int q[N],hh=1,tt=0; void push(int x){ q[++tt]=x; } void pop(){hh++;} bool empty(){return hh<=tt?0:1;} int front(){ return q[hh]; } };