Under construction

Still being built. Things may change

Shop

Time limit2sMemory limit1024 MB

Summary
Given a product price and a percent range, find the cheapest candidate gift whose price falls between a and b percent of that price.
Level

Easy2 of 10

Topics
Implementation, Array
Solved
No attempts yet

Problem

You are a middle manager at a store. Your boss has asked you to run a promotion that draws in customers. Under the promotion, a buyer who purchases one product receives another product as a gift.

You are given the product that will come with a gift. The gift must cost at least aa percent and at most bb percent of the product's price. For the store's benefit, the gift's price must be as low as possible.

Choose the gift for the given product.

Input

The first line contains the name of the product that will come with a gift. The second line contains the product's price tt (1≤t≤1091 \le t \le 10^9). The third line contains two positive integers aa and bb (1≤a≤b≤1001 \le a \le b \le 100). The fourth line contains nn (1≤n≤10001 \le n \le 1000), the number of candidate gift products.

Each candidate is described by two lines. The first line is the candidate's name, and the second line is its price xix_i (1≤xi≤1091 \le x_i \le 10^9).

All candidate prices are distinct. Names are at most 20 characters long and use characters with codes 32 to 127, which means Latin letters, punctuation, arithmetic signs, digits, and spaces.

Output

Print the name of the candidate chosen as the gift on a single line. The problem guarantees that such a candidate exists.

Examples1

  1. Example 1

    Input
    Coca-Cola 2l+2l.
    120
    15 25
    3
    Coca-Cola 0,5l.
    20
    Dirol
    14
    Ice-cream
    40
    
    Expected output
    Coca-Cola 0,5l.