<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<stdio.h>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>
#include<assert.h>
#include<set>
#include<cmath>
#include<queue>
#include<cstdlib>
#include<iostream>
#include<bitset>
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back
#define rep(i,j,k) for(int i=(int)(j);i<=(int)(k);i++)
#define per(i,j,k) for(int i=(int)(j);i>=(int)(k);i--)
using namespace std;
typedef long long LL;
//template
typedef double db;
const db eps=1e-10;
const db pi=acosl(-1.0);
int sign(db x){if(x<-eps)return -1;if(x>eps)return 1;return 0;}
int cmp(db x,db y){return sign(x-y);}
struct po{
	db x,y;
	po(db _x=0,db _y=0):x(_x),y(_y){}
};
po operator +(const po &a,const po &b){return po(a.x+b.x,a.y+b.y);}
po operator -(const po &a,const po &b){return po(a.x-b.x,a.y-b.y);}
po operator *(const po &a,const db &b){return po(a.x*b,a.y*b);}
po operator /(const po &a,const db &b){return po(a.x/b,a.y/b);}
db operator *(const po &a,const po &b){return a.x*b.x+a.y*b.y;}
db operator ^(const po &a,const po &b){return a.x*b.y-a.y*b.x;}
db mo2(po a){return a*a;}
db mo(po a){return sqrt(a*a);}
po proj(po x,po y){//proj x to y
	return y*((x*y)/mo2(y));
}
po refl(po x,po y){//refl x from y
	return proj(x,y)*2-x;
}
//template
int main(){
	po p1,p2;
	scanf("%lf%lf%lf%lf",&p1.x,&p1.y,&p2.x,&p2.y);
	int t;scanf("%d",&t);
	p2=p2-p1;
	while(t--){
		po x;scanf("%lf%lf",&x.x,&x.y);
		x=x-p1;
		db w=(x^p2);
		if(sign(w)==1){
			puts("CLOCKWISE");
			continue;
		}
		if(sign(w)==-1){
			puts("COUNTER_CLOCKWISE");
			continue;
		}
		if(sign(x*p2)==-1){
			puts("ONLINE_BACK");
			continue;
		}
		if(cmp(mo2(x),mo2(p2))<=0){
			puts("ON_SEGMENT");
			continue;
		}
		puts("ONLINE_FRONT");
		continue;
	}
	return 0;
}




