DVD#624

DVD

1 second
64 megabytes
Hard

Petya has a new computer game, and his friends brought him blank DVD discs, asking him to make copies of the game. Petya promised that everything would be ready in M+1 seconds. However, as soon as Petya started recording the first disc, he remembered there were ongoing renovations at his home, and there will be power outages, which could prevent him from finishing in time. Petya's friends consider him responsible, so they will be upset if he does not finish on time.

The game takes up all the free space of a single DVD disc. Petya's drive, called StrangeDVD, supports writing at speeds of , , and , but here the value of may be different from the standard — for example, on the StrangeDVD drive may not match on other drives. Assume the drive tray opens and closes instantly, and Petya can instantly remove and insert discs, so the only time spent is on actual recording. The drive does not support multisession, so each disc must be recorded in one uninterrupted session.

Recording at results in quality ; at — quality ; at — quality . Determine how much time Petya will spend recording the discs so that the total quality is maximized, and if there are several ways, the spent time is minimized.

Power outages are not coordinated and may overlap. If another outage starts while the power is already off, it does not have any further effect. For example, if three outages are planned: from the st to th second, from the th to th, and from the th to th, the power will go off at the start of the st second, at the th nothing happens (since power is already off), turned on at the th second, turned off again at the th, and turned on at the st. No two teams interrupt the power at the same moment. Time is measured from the second; in total, there are M+1 seconds (0, 1, …, M).

Input

The program reads the numbers (the number of the last second Petya has), (the number of discs), (the time in seconds required to write one copy at ; for : , for : ), and (the number of power outages). Then pairs P_1, P_2 follow: the beginning and end (second numbers) of each outage. These pairs may not be sorted chronologically but always P_1 \leq P_2. All numbers are separated by spaces.

0 \leq M, N, P_{1_{i}}, P_{2_{i}} \leq 2\ 000\ 000\ 000, 1 \leq Q \leq 500\ 000\ 000 (or 1 \leq 4Q \leq 2\ 000\ 000\ 000), 0 \leq K \leq 10\ 000.

Output

The program should output if Petya cannot finish recording all the discs. Otherwise, output the number of the last second Petya uses for recording, and the total quality achieved, separated by a space.

Examples

Example 1

Loading
Loading