<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 <bits/stdc++.h>
using namespace std;

#define EPS 1e-10

class point {
public:
	double x, y;
	point() {}
	point( double x_, double y_ ) : x(x_), y(y_) {}
	point operator -( point p ) { return point( x - p.x, y - p.y ); }
	point operator +( point p ) { return point( x + p.x, y + p.y ); }
	point operator *( int a ) { return point( x * a, y * a ); }
};

class segment {
public:
	point p1, p2;
	segment() {}
};

double dot( point a, point b ) { return a.x * b.x + a.y * b.y; }
double cross( point a, point b ) { return a.x * b.y - a.y * b.x; }
double norm( point a ) { return a.x * a.x + a.y * a.y; }

double distance( segment s, point p )
{
	if( dot( s.p2 - s.p1, p - s.p1 ) < 0 ) return sqrt( norm( p - s.p1 ) );
	if( dot( s.p1 - s.p2, p - s.p2 ) < 0 ) return sqrt( norm( p - s.p2 ) );;
	return fabs( cross( s.p2 - s.p1, p - s.p1 ) / sqrt( norm( s.p2 - s.p1 ) ) );
}

int ccw( point p0, point p1, point p2 )
{
	point v1 = p1 - p0;
	point v2 = p2 - p0;
	if( cross( v1, v2 ) > EPS ) return 1;
	if( cross( v1, v2 ) < -EPS ) return -1;
	if( dot( v1, v2 ) < -EPS ) return 2;
	if( norm( v1 ) < norm( v2 ) ) return -2;
	return 0;
}

bool intersect( segment s1, segment s2 )
{
	return ccw( s1.p1, s1.p2, s2.p1 ) * ccw( s1.p1, s1.p2, s2.p2 ) <= 0 &&
			ccw( s2.p1, s2.p2, s1.p1 ) * ccw( s2.p1, s2.p2, s1.p2 ) <= 0;
}

double distance( segment s1, segment s2 )
{
	if( intersect( s1, s2 ) ) return 0;
	return min( { distance( s1, s2.p1 ), distance( s1, s2.p2 ),
					distance( s2, s1.p1 ), distance( s2, s1.p2 ) } );
}

int main()
{
	segment s;
	cin >> s.p1.x >> s.p1.y >> s.p2.x >> s.p2.y;
	int q;
	cin >> q;
	for( int i = 0; i < q; i++ ) {
		point p;
		cin >> p.x >> p.y;
		int ret = ccw( s.p1, s.p2, p );
		string ans = "ON_SEGMENT";
		if( ret == 1 ) ans = "COUNTER_CLOCKWISE";
		if( ret == -1 ) ans = "CLOCKWISE";
		if( ret == 2 ) ans = "ONLINE_BACK";
		if( ret == -2 ) ans = "ONLINE_FRONT";

		cout << ans << endl;
	}
}

