- Time limit: 1.00 s
- Memory limit: 128 MB
The border of Oopse is a polygon consisting of straight segments. The vertices of the fence are in order .
The tax officer of Oopse needs to know for each houses if they reside in Oopse or not. Unfortunately the officer is bad at reading maps and needs your help.
Input
The first line contains a single integer, , the number of line segments describing the border of Oopse.
The next lines each consist of two integers and : the position of vertex is .
Then the input contains a single integer, , the number of houses the tax officer needs to query.
The rest lines each consist of two integers and : the position of house is .
Output
For each house print a single line consisting either of "inside" (the house resides inside Oopse), "border" (the house resides on the border of Oopse) or "outside" (the house resides outside Oopse).
Limits
- each coordinate is in the range
Example
Input:
5 2 1 3 2 5 1 5 4 2 5 3 3 4 4 5 5 3
Output:
inside outside border