A. High Frequency
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

You have been hired by a Brazilian HFT (High Frequency Trading) company, which uses robots to buy and sell stocks on the stock exchange in fractions of a second in a fully systematic and automated way. Your first task is to implement a signal: a number, computed from the current state of the market, that guides the robot's decision between buying, selling, or doing nothing. The signal you will compute determines whether, at that moment, there is more buying demand or more selling supply for a stock.

On the exchange, whoever wants to buy or sell stocks registers an order in the order book. The book consists of two queues: buy orders and sell orders. Orders are grouped into price levels, ordered from best to worst. For each level $$$i$$$, you are given $$$c_i$$$ (total shares in buy orders) and $$$v_i$$$ (total shares in sell orders).

The signal measures the book's imbalance for the first $$$n$$$ levels: $$$$$$ I_n = \frac{C_n - V_n}{C_n + V_n}, \qquad \text{where } C_n = \sum_{i=1}^{n} c_i \text{ and } V_n = \sum_{i=1}^{n} v_i. $$$$$$

The value of $$$I_n$$$ always lies between $$$-1$$$ and $$$1$$$ and is interpreted as follows:

  • if $$$I_n \gt 0$$$, the signal indicates COMPRA;
  • if $$$I_n \lt 0$$$, the signal indicates VENDA;
  • if $$$I_n = 0$$$, the signal indicates NEUTRO.

Given the order book and a series of queries, where the $$$j$$$-th query has depth $$$n_j$$$, report the signal corresponding to each query.

Input

The first line contains an integer $$$N$$$ ($$$1 \leq N \leq 10^{5}$$$), the number of levels in the order book.

Each of the following $$$N$$$ lines contains two integers $$$c_i$$$ and $$$v_i$$$ ($$$0 \leq c_i, v_i \leq 10000$$$), respectively the total shares in the buy orders and sell orders at level $$$i$$$. It is guaranteed that $$$c_1 + v_1 \gt 0$$$.

The next line contains an integer $$$Q$$$ ($$$1 \leq Q \leq 10^{5}$$$), the number of queries. Each of the following $$$Q$$$ lines contains an integer $$$n_j$$$ ($$$1 \leq n_j \leq N$$$), the depth of the $$$j$$$-th query.

Output

Your program must produce $$$Q$$$ lines. The $$$j$$$-th line must contain a single word: COMPRA if $$$I_{n_j} \gt 0$$$, VENDA if $$$I_{n_j} \lt 0$$$, or NEUTRO if $$$I_{n_j} = 0$$$.

Examples
Input
4
10 2
1 9
0 7
8 1
4
1
2
3
4
Output
COMPRA
NEUTRO
VENDA
NEUTRO
Input
1
5 3
2
1
1
Output
COMPRA
COMPRA