<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>
typedef long long ll;
typedef long double ld;
const ll inf=1e9+7;
#define y1 _y_1_
#ifndef gc
	#define gc getchar
#endif
#ifndef pc
	#define pc putchar
#endif
inline ll read(){ll f=0,x=0;register char c=gc();while(!isdigit(c))f^=c=='-',c=gc();while(isdigit(c))x=(x<<3)+(x<<1)+(c^'0'),c=gc();return x=f?-x:x;}
inline ll read(ll&x){ll f=0;x=0;register char c=gc();while(!isdigit(c))f^=c=='-',c=gc();while(isdigit(c))x=(x<<3)+(x<<1)+(c^'0'),c=gc();return x=f?-x:x;}
inline void writeln(){pc('\n');}
inline void write(ll x){if(x<0)pc('-'),x=-x;if(x>9)write(x/10);pc(x%10+'0');}
inline void writeln(const ll&x){write(x),pc('\n');}
using namespace std;
ll Q;
const ld eps=1e-6;
struct vec{
	ld x,y;
	inline bool is_zero(){return (abs(x)<=eps)&(abs(y)<=eps);}
	inline void scan(){x=read(),y=read();}
	inline vec(){x=y=0;}
	inline vec(const ld&X,const ld&Y){x=X,y=Y;}
	inline friend vec operator +(const vec&A,const vec&B){return vec(A.x+B.x,A.y+B.y);}
	inline friend vec operator -(const vec&A,const vec&B){return vec(A.x-B.x,A.y-B.y);}
	inline ld len(){return sqrt(x*x+y*y);}
	inline ld len(const ll&X,const ll&Y){return sqrt((x-X)*(x-X)+(y-Y)*(y-Y));}
	inline ld k(){return (x==0)?inf:y/x;}
	inline ld k(const ll&X,const ll&Y){return (x==X)?inf:(y-Y)/(x-X);}
	inline friend ld Dot(const vec&A,const vec&B){return A.x*B.x+A.y*B.y;}
	inline friend ld Cross(const vec&A,const vec&B){return A.x*B.y-B.x*A.y;}
	inline friend ld Theta(vec A,vec B){return acos(Cross(A,B)/A.len()/B.len());}
}p0,p1,p2;
signed main(){
	p0.scan(),p1.scan(),p1=p1-p0;
	read(Q);while (Q--){
		p2.scan(),p2=p2-p0;
		if (Cross(p1,p2)>=eps) puts("COUNTER_CLOCKWISE");
		else if (Cross(p1,p2)<-eps) puts("CLOCKWISE");
		else if (Dot(p1,p2)<-eps) puts("ONLINE_BACK");
		else puts(p1.len()<p2.len()?"ONLINE_FRONT":"ON_SEGMENT");
	}
	fclose(stdin);fclose(stdout);return 0;
}
