Trapped in the Haybales

No attempts yetTime limit1sMemory limit256 MB

Problem

Farmer John received NN hay bales and put them at various points along the straight road that connects his barn with his house. Bale jj has size SjS_j and position PjP_j, and no two bales share a position. Bessie the cow stands at position BB, 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 DD units of distance, she builds up enough speed to smash through a bale of size strictly less than DD 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.

Input

The first line contains NN and Bessie's starting position BB. Each of the next NN lines describes one bale with two integers, its size and its position.

1N100,0001 \le N \le 100{,}000, and every size, every position and BB are integers between 11 and 10910^9. The positions are distinct, and no bale sits at position BB.

Output

Print a single integer, the smallest amount of hay FJ has to add. Print 00 if Bessie is already trapped. Print 1-1 if she escapes no matter which bale gets hay and how much.