CSES - KILO 2017 2/5 - Planning
  • Time limit: 1.00 s
  • Memory limit: 512 MB

You are organizing a programming contest in Syrjälä. There will be n participants attending the contest. You should choose a weekend when the contest is held and a suitable hotel for the participants to stay in.

You have some constraints: The total cost of the event 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, the number of participants, b, the budget, h, the number of hotels to consider and w, the number of weekends you can choose between. Then follow two lines for each of the h hotels. The first gives p_i, the price for one person staying the weekend at the hotel. The second contains w integers, a_1, a_2, \ldots a_w, 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.

Constaints

  • 1 \le n \le 200
  • 1 \le b \le 5 \cdot 10^5
  • 1 \le h \le 18
  • 1 \le w \le 13
  • 1 \le p_i \le 10^4
  • 0 \le a_i \le 1000

Example

Input:

3 1000 2 3
200
0 2 2
300
27 3 20

Output:

900

Input:

5 2000 2 4
300
4 3 0 4
450
7 8 0 13

Output:

stay home