A.127B.255C.128D.256
A.rear==n-1B.(front+1)%n==rearC.front==rearD.front==(rear+1)%n
A.r-fB.(m-f-r)%mC.(m+f-r)%mD.(m+r-f)%m