I want to be a good teacher, so I decided to memorize all my students' names. However, I gave up shortly after because there were too many students to remember. But I cannot let my students find out, or I would lose face. So, every time I need to call a student's name, I refer to the student I know who is closest to them. For example, if there are 10 students:
A ? ? D ? ? ? H ? ?
When calling each student, the specific way to address them is:
| Position | Address |
|---|---|
| 1 | A |
| 2 | right of A |
| 3 | left of D |
| 4 | D |
| 5 | right of D |
| 6 | middle of D and H |
| 7 | left of H |
| 8 | H |
| 9 | right of H |
| 10 | right of right of H |
Input
The input contains only one test case. The first line is the number of students $n$ ($1 \le n \le 100$). The second line gives each student's name in order from left to right, separated by spaces. Each name is either a string of at most 3 English letters or a question mark. At least one student's name is not a question mark. The next line is the number of queries $q$ ($1 \le q \le 100$). Each query contains an integer $p$ ($1 \le p \le n$), which is the position of the student to be called (the leftmost is position 1).
Output
For each query, output the address. Note that "middle of X and Y" is only used when the student being called has two nearest known students X and Y, and X is to the left of Y.
Examples
Input 1
10 A ? ? D ? ? ? H ? ? 4 3 8 6 10
Output 1
left of D H middle of D and H right of right of H