#GYM104597A. Asientos

Asientos

Description

With final exams just around the corner, Juan and his friends have decided to spend the week in the library studying. Since they are going to spend so much time in there, it is essential that they choose the best seats to concentrate. The best seats are the ones where there is a little air flowing: the ones by the window and by the aisle.

The library has $f$ rows and $a$ seats per row, and library seats follow the numbering shown in the picture: on the left is the window, on the right is the aisle, and the seats are numbered in ascending order from left to right in the first row, from right to left in the second row, from left to right again in the third row, and so on.

Would you be able to tell, given a seat number, whether it is in window or aisle?

  1. (15 points) $a = 1$.
  2. (20 points) $f = 1$.
  3. (30 points) $T \leq 1\,000$, $f \cdot a \leq 1\,000$.
  4. (35 points) No additional constraints.

The first line of the input contains the number of cases $T$.

For each case there will be a line with $3$ numbers: $f$, the number of rows, $a$, the number of seats, and $n$, the seat number to query.

For each case, you must print a line with the answer: VENTANA if the seat is next to the window, PASILLO if it is next to the aisle, AMBOS if it is next to both, or :( if it is next to neither.

Input

The first line of the input contains the number of cases $T$.

For each case there will be a line with $3$ numbers: $f$, the number of rows, $a$, the number of seats, and $n$, the seat number to query.

Output

For each case, you must print a line with the answer: VENTANA if the seat is next to the window, PASILLO if it is next to the aisle, AMBOS if it is next to both, or :( if it is next to neither.