Internal point#2300

Internal point

2 seconds
128 megabytes
Easy

Given a strictly convex -gon and points.

For each point, determine its location: inside, on the border, or outside the polygon.

Input

First, the number (3 \leq n \leq 10^5) is given. Then, points follow, which are the vertices of the polygon.

After that, the number (0 \leq k \leq 10^5) is given. Then, points follow, which are the query points.

All coordinates are integers and do not exceed 10^7 by absolute value.

Output

For each query, output INSIDE, BORDER, or OUTSIDE on a separate line.

Examples

Example 1

Loading
Loading