<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 lb long double
#define eps 1e-9
using namespace std;
struct Po{lb x,y;}p1,p2,x,np;
int t; 
void get(Po &x){scanf("%Lf %Lf",&x.x,&x.y);}
Po operator -(Po x,Po y){return (Po){x.x-y.x,x.y-y.y};}
Po operator +(Po x,Po y){return (Po){x.x+y.x,x.y+y.y};}
lb operator *(Po x,Po y){return x.x*y.y-x.y*y.x;}
lb operator ^(Po x,Po y){return x.x*y.x+x.y*y.y;}
lb le2(Po x){return x.x*x.x+x.y*x.y;}
int main(){
	get(p1);get(p2);np=p2-p1;
	scanf("%d",&t);
	while (t--){
		get(x);
		Po nx=x-p1;
		lb cj=nx*np;
		if (cj>eps)puts("CLOCKWISE");
		if (cj<-eps)puts("COUNTER_CLOCKWISE");
		if (fabs(cj)<eps){
			if ((nx^np)<-eps)puts("ONLINE_BACK");
			else if (le2(nx)<le2(np)+eps)puts("ON_SEGMENT");else puts("ONLINE_FRONT");
		}
	}
	return 0;
}
