Elevators
To move a new safe to his office on the N-th floor of a skyscraper, Vitya needs the assistance of movers once again. However, the payment system has changed. Now, the cost for moving one floor up via stairs is U hryvnias, moving one floor down via stairs costs D hryvnias, entering an elevator costs I hryvnias, and exiting an elevator costs J hryvnias.
In the building, there are L elevators, each stopping only on specific floors.
Help Vitya find the most cost-effective route to transport the safe from the first floor to his office.
Input
The first line of the input contains the integers N, U, D, I, J, L. Each of the next L lines describes an elevator. It begins with the number K_i — the number of floors the i-th elevator stops at, followed by K_i natural numbers indicating the specific floors (listed in ascending order) where this elevator stops. Constraints are as follows: 0 ≤ U ≤ 1000, 0 ≤ D ≤ 1000, 0 ≤ I ≤ 1000, 0 ≤ J ≤ 1000, 0 ≤ L ≤ 500, 1 ≤ N ≤ 1000000, 2 ≤ K_i ≤ 1000, and K_1+K_2+…+K_L ≤ 1000. The total number of floors in the skyscraper does not exceed 1000000.
Output
Output a single number — the minimum cost to lift the safe.