n,m;main(x,y){scanf("%d%d%d%d",&n,&m,&x,&y);x--,y--;x%=2*m,y%=2*m;x