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 nn 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: nn, the number of participants, bb, the budget, hh, the number of hotels to consider and ww, the number of weekends you can choose between. Then follow two lines for each of the hh hotels. The first gives pip_i, the price for one person staying the weekend at the hotel. The second contains ww integers, a1,a2,awa_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

  • 1n2001 \le n \le 200
  • 1b51051 \le b \le 5 \cdot 10^5
  • 1h181 \le h \le 18
  • 1w131 \le w \le 13
  • 1pi1041 \le p_i \le 10^4
  • 0ai10000 \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