All team is in the Matrix and need your help to escape!
Matrix is an infinite discrete world of square cells (x,y). There are some infinite height buildings and you have all records about them. The record (x,y) means that building occupies all cells (x′,y′):x′=x,y′≤y. In other words, building is a one cell width strip which goes infinitely down. All buildings have pairwise distinct x coordinates.
There are q team members. For each team member you know his current cell and finish cell in which there is his exit from Matrix. Note that each team member should use his own exit and can't use exit of some other team member.
In one second each team member can go from cell (x,y) to any of cells (x+1,y),(x−1,y),(x,y−1),(x,y+1) if corresponding cell is not occupied by building. Once a person reaches cell with his exit, he can exit from the Matrix instantly.
For each team member you have to find minimum time which he needs to exit from the Matrix.
Input format
The first line of input contains two space separated integers n and q (1≤n,q≤3⋅105) - the number of buildings and the number of team members.
Next n lines contain records about buildings. The i-th of them contains two space separated integers xi and yi (−109≤xi,yi≤109) - the parameters of the i-th building.
Next q lines contain information about team members. The i-th of them contains four space separated integers sxi, syi, fxi and fyi (−109≤sxi,syi,fxi,fyi≤109) - the current cell of the i-th team member and the cell where his exit is located. It is guaranteed that neither (sxi,syi) nor (fxi,fyi) belong to any building.
Output format
Print q lines. On the i-th of them print the single integer - the required time for escape for the i-th team member.