<image>

For given three points p0, p1, p2, print


COUNTER_CLOCKWISE


if p0, p1, p2 make a counterclockwise turn (1),


CLOCKWISE


if p0, p1, p2 make a clockwise turn (2),


ONLINE_BACK


if p2 is on a line p2, p0, p1 in this order (3),


ONLINE_FRONT


if p2 is on a line p0, p1, p2 in this order (4),


ON_SEGMENT


if p2 is on a segment p0p1 (5).

Constraints

* 1 ≤ q ≤ 1000
* -10000 ≤ xi, yi ≤ 10000
* p0 and p1 are not identical.

Input


xp0 yp0 xp1 yp1
q
xp20 yp20
xp21 yp21
...
xp2q-1 yp2q-1


In the first line, integer coordinates of p0 and p1 are given. Then, q queries are given for integer coordinates of p2.

Output

For each query, print the above mentioned status.

Examples

Input

0 0 2 0
2
-1 1
-1 -1


Output

COUNTER_CLOCKWISE
CLOCKWISE


Input

0 0 2 0
3
-1 0
0 0
3 0


Output

ONLINE_BACK
ON_SEGMENT
ONLINE_FRONT
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
template<class T> 
inline void read(T& x)
{
	char c = getchar(); T p = 1, n = 0;
	while(c < '0' || c > '9'){if(c == '-') p = -1; c = getchar();}
	while(c >= '0' && c <= '9'){n = n * 10 + c - '0'; c = getchar();}
	x = p * n;
}
template<class T, class U>
inline void read(T& x, U& y){read(x), read(y);}
template<class T, class U, class V>
inline void read(T& x, U& y, V& z){read(x), read(y), read(z);}
struct Point
{
	double x, y;
	Point(int a, int b){x = a, y = b;}
	Point(double a = .0, double b = .0){x = a, y = b;}
	Point operator+(const Point& r){return Point(x + r.x, y + r.y);}
	Point operator-(const Point& r){return Point(x - r.x, y - r.y);}
	Point operator*(double r){return Point(x * r, y * r);}
	double operator*(const Point& r){return x * r.y - y * r.x;}
};
typedef Point Vector;
double dot(Vector l, Vector r){return l.x * r.x + l.y * r.y;}
double norm(Vector l){return dot(l, l);}
char* ccw(Point x, Point y, Point z)
{
	double cross = (y - x) * (z - x);
	if(cross > 0) return "COUNTER_CLOCKWISE";
	if(cross < 0) return "CLOCKWISE";
	if(dot(y - x, z - x) < 0) return "ONLINE_BACK";
	if(norm(y - x) < norm(z - x)) return "ONLINE_FRONT";
	return "ON_SEGMENT";
}
int main()
{
	int x0, y0, x1, y1, x, y; read(x0, y0), read(x1, y1);
	int q; read(q);
	while(q--)
	{
		read(x, y);
		puts(ccw(Point(x0, y0), Point(x1, y1), Point(x, y)));
	}
	return 0;
}