Farmer John received N hay bales and put them at various points along the straight road that connects his barn with his house. Bale j has size Sj and position Pj, and no two bales share a position. Bessie the cow stands at position B, where there is no bale.
Bessie moves freely along the road and can walk right up to the position of a bale, but she cannot pass through that position. There is one exception: if she runs in the same direction for D units of distance, she builds up enough speed to smash through a bale of size strictly less than D and remove it for good. Removing a bale gives her a longer run, so she may smash other bales as well.
FJ is repainting his house and his barn, and he wants Bessie to reach neither one. He therefore wants to make sure she never breaks through the leftmost or the rightmost bale. To help, he can pick a single bale and add hay to it, raising its size by any nonnegative amount. Find the smallest amount of hay he has to add to keep Bessie trapped.
The first line contains N and Bessie's starting position B. Each of the next N lines describes one bale with two integers, its size and its position.
1≤N≤100,000, and every size, every position and B are integers between 1 and 109. The positions are distinct, and no bale sits at position B.
Print a single integer, the smallest amount of hay FJ has to add. Print 0 if Bessie is already trapped. Print −1 if she escapes no matter which bale gets hay and how much.