Candies
Fuad loves to eat candies, and there is a big confectionery shop near their house. This shop has announced a new promotion. When paying in cash, they return the change to their customers in candies. One candy for each qapik.
Of course, the number of candies they give cannot exceed , because qapiks can be replaced with manat, and the shop always follows this principle.
Fuad's grandmother gave him manats in cash and told him to buy a cake at the confectionery. The shop sells different cakes. The price of cake is manats and qapiks.
Now Fuad is only concerned about which cake to buy to get as many candies as possible. He doesn't care whether the cake he buys is expensive or cheap.
Find the maximum number of candies that Fuad can get. If Fuad doesn't have enough money to buy any cake, print .
Input
The first line contains two integers and . Each of the following lines contains two integers and .
Output
Print the maximum number of candies that Fuad can get from buying one cake, and if he doesn't have enough money to buy any cake.