Present your documents!
At birth, a person receives N documents, each uniquely numbered from 1 to N. Each document i has an associated importance A_i and a cost B_i. Throughout their life, the person will attend M significant events, and for each event, they must surrender one of their documents. To attend event j, the document given must have an importance between C_j and D_j, inclusive. Naturally, the person will choose to give away the least expensive document that meets these criteria.
Your task is to help the person successfully participate in all these important events.
Input
The input begins with the integer N (1 ≤ N ≤ 10^5), followed by N pairs of integers A_i and B_i (1 ≤ A_i, B_i ≤ 10^9). Next, the integer M (1 ≤ M ≤ 10^5) is provided, followed by M pairs of integers C_j and D_j (1 ≤ C_j ≤ D_j ≤ 10^9). Note that all document costs are distinct.
Output
Output M integers, where the j-th integer represents the number of the document given at the j-th event. Separate each number with a space.
If it is impossible to attend all events, output the word BOTVA.