<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>
#define maxn 100005
#define maxm 500005
#define inf 0x7fffffff
#define ll long long
#define ld long double
#define debug(x) cerr<<#x<<": "<<x<<endl
#define fgx cerr<<"--------------"<<endl
#define dgx cerr<<"=============="<<endl

using namespace std;
struct vc{
	ld x,y;
	vc operator*(const ld b){vc t;t.x=x*b,t.y=y*b;return t;}
};
struct pt{
	ld x,y;
	pt operator+(const vc b){pt t;t.x=x+b.x,t.y=y+b.y;return t;}
	vc operator-(const pt b){vc t;t.x=x-b.x,t.y=y-b.y;return t;}
};

inline int read(){
	int x=0,f=1; char c=getchar();
	for(;!isdigit(c);c=getchar()) if(c=='-') f=-1;
	for(;isdigit(c);c=getchar()) x=x*10+c-'0';
	return x*f;
}

inline pt get(){pt t;t.x=read(),t.y=read();return t;}
inline ld cross(vc a,vc b){return a.x*b.y-a.y*b.x;}
inline ld dot(vc a,vc b){return a.x*b.x+a.y*b.y;}
inline ld len(vc a){return dot(a,a);}

int main(){
	pt p0=get(),p1=get();
	int Q=read();
	while(Q--){
		pt p2=get(); 
		vc a=p1-p0,b=p2-p0;
		ld cj=cross(a,b);
		if(cj!=0){
			if(cj>0) printf("COUNTER_CLOCKWISE\n");
			else printf("CLOCKWISE\n");
		}
		else{
			if(dot(a,b)<0) printf("ONLINE_BACK\n");
			else{
				if(len(a)<len(b)) printf("ONLINE_FRONT\n");
				else printf("ON_SEGMENT\n");
			}
		}
	}
	return 0;
}

