You are working in Advanced Computer Monitors (ACM), Inc. The company is building and selling
giant computer screens that are composed from multiple smaller screens. Your are responsible for
design of the screens for your customers.

Customers order screens of the specified horizontal
and vertical resolution in pixels and a specified horizontal and vertical size in millimeters.
Your task is to design a screen that has a required resolution in each dimension or more, and has
required size in each dimension or more, with a minimal possible price. The giant screen is always
built as a grid of monitors of the same type. The total resolution, size, and price of the resulting
screen is simply the sum of resolutions, sizes, and prices of the screens it is built from.

You have a choice of regular monitor types that you can order and you know their resolutions, sizes, and prices.
The screens of each type can be mounted both vertically and horizontally, but the whole giant
screen must be composed of the screens of the same type in the same orientation. You can use as many
screens of the chosen type as you need.

Input file format

The first line of the input file contains four integer numbers r_{h}, r_{v}, s_{h}, and s_{v}
(all from 100 to 10^{4} inclusive) — horizontal and vertical resolution and horizontal and vertical size
of the screen you have to build, respectively. The next line contains a single integer number n (1 ≤ n ≤ 100) — the number of different screen types available to you. The next n lines contain descriptions
of the available screen types. Each description occupies one line and consists of five integer numbers —
r_{h,i}, r_{v,i}, s_{h,i}, s_{v,i}, p_{i} (all from 100 to 10\,000 inclusive), where first
four numbers are horizontal and vertical resolution and horizontal and vertical size of i-th screen type,
and p_{i} is the price.

Output file format

Write to the output file a single integer — the minimal price of the specified giant screen.