CSES - Taxing
  • Time limit: 1.00 s
  • Memory limit: 128 MB

The border of Oopse is a polygon consisting of nn straight segments. The vertices of the fence are in order (x1,y1),(x2,y2),,(xn,yn)(x_1,y_1),(x_2,y_2),\ldots,(x_n,y_n).

The tax officer of Oopse needs to know for each mm 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, nn, the number of line segments describing the border of Oopse.

The next nn lines each consist of two integers xix_i and yiy_i: the position of ithi^{th} vertex is (xi,yi)(x_i, y_i).

Then the input contains a single integer, mm, the number of houses the tax officer needs to query.

The rest mm lines each consist of two integers xkx_k and yky_k: the position of kthk^{th} house is (xk,yk)(x_k, y_k).

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

  • 3n10003 \le n \le 1000
  • 1m1001 \le m \le 100
  • each coordinate is in the range 106106-10^6 \ldots 10^6

Example

Input:

5
2 1
3 2
5 1
5 4
2 5
3
3 4
4 5
5 3

Output:

inside
outside
border