As you didn't show up to the yearly general meeting of the Cool Club of Postcard Collectors, you were unanimously elected to organize this years excursion to Stamp City. You are free to choose from a number of weekends this autumn, and have to Find a suitable hotel to stay at, preferably as cheap as possible. You have some constraints: The total cost of the trip must be within budget, of course. All participants must stay at the same hotel, to avoid last years catastrophe, where some members got lost in the city, never being seen again.
Input:
The first line of input consists of four integers: n,b,h,w.
n the number of participants
b the budget
h the number of hotels to consider
w the number of weeks you can choose between.
Then follow two lines for each of the H hotels.
The first gives p, the price for one person staying the weekend at the hotel. The second contains w integers a giving the number of available beds for each weekend at the hotel.
Output:
Output the minimum cost of the stay for your group, or "stay home" if nothing can be found within the budget.
Constraints:
1<=n<=20
1<=b<=500000
1<=h<=18
1<=w<=13
1<=p<=10000
1<=a<=1000