<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<iostream>
#include<cstdio>
#include<cmath>

struct Point{
	long long X,Y;
	inline void read(){scanf("%lld%lld",&X,&Y);}
	inline long long plength(){return X*X+Y*Y;}
	Point(){X=Y=0;}
	Point(long long X_,long long Y_){X=X_,Y=Y_;}
};
struct Line{
	Point A,B;
	inline void read(){A.read(),B.read();}
	Line(){}
	Line(const Point &A_,const Point &B_){A=A_,B=B_;}
};
typedef Point Vector;
inline Vector operator - (const Point &A,const Point &B){return Vector(A.X-B.X,A.Y-B.Y);}
inline long long operator ^ (const Point &A,const Point &B){return A.X*B.X+A.Y*B.Y;}
inline long long operator * (const Point &A,const Point &B){return A.X*B.Y-A.Y*B.X;}
inline Point operator + (const Point &A,const Vector &B){return Point(A.X+B.X,A.Y+B.Y);}
inline Vector operator * (const Vector &A,long long k){return Vector(A.X*k,A.Y*k);}

int Q;

inline long long sqr(long long k){return k*k;}

Point Projection(const Line &L,const Point &P){
	long long len=((P-L.A)^(L.B-L.A))/(L.B-L.A).plength();
	return L.A*(1-len)+L.B*len;
}

Point Reflection(const Line &L,const Point &P){
	Point projection=Projection(L,P);
	return projection+(projection-P);
}

int CCW(const Point &P0,const Point &P1,const Point &P2){
	long long cro=(P1-P0)*(P2-P0);
	if (cro) return cro>0?0:1;
	long long dot=(P1-P0)^(P2-P0);
	if (dot<0) return 2;
	else return (P1-P0).plength()<(P2-P0).plength()?3:4;
}

Point P0,P1,P2;

const char result[5][20]={"COUNTER_CLOCKWISE","CLOCKWISE","ONLINE_BACK","ONLINE_FRONT","ON_SEGMENT"};

int main(){
	P0.read(),P1.read();
	scanf("%d",&Q);
	while (Q--){
		P2.read();
		puts(result[CCW(P0,P1,P2)]);
	}
}

