<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 REP(i,first,last) for(int i=first;i<=last;++i)
#define DOW(i,first,last) for(int i=first;i>=last;--i)
using namespace std;
inline int Read()
{
	int x(0),f(1);
	char c(getchar());
	while(c<'0'||'9'<c)
	{
		if(c=='-')
		{
			f=-1;
		}
		c=getchar();
	}
	while('0'<=c&&c<='9')
	{
		x=(x<<1)+(x<<3)+c-'0';
		c=getchar();
	}
	return f*x;
}
void Write(int x)
{
	if(x<0)
	{
		printf("-");
		x=-x;
	}
	if(9<x)
	{
		Write(x/10);
	}
	putchar(x%10+'0');
}
inline void Writeln(int x)
{
	Write(x);
	puts("");
}
struct Point
{
	double x,y;
	Point(double fx=0,double fy=0)
	{
		x=fx;
		y=fy;
	}
	void Read()
	{
		scanf("%lf%lf",&x,&y);
	}
	double operator ^(Point const b)const
	{
		return x*b.x+y*b.y;
	}
	double operator *(Point const b)const
	{
		return x*b.y-b.x*y;
	}
	double operator ==(Point const b)const
	{
		return sqrt((x-b.x)*(x-b.x)+(y-b.y)*(y-b.y));
	}
};
struct Vector
{
	Point a,b;
	Vector(Point f=Point(0,0),Point e=Point(0,0))
	{
		a=f;
		b=e;
	}
	double operator |(Vector const c)const
	{
		return (a.x-b.x)*(c.a.y-c.b.y)-(c.a.x-c.b.x)*(a.y-b.y);
	}
};
const int MAXN=1e5+5;
Point p0,p1,p2;
void Work()
{
	p2.Read();
	double c=Vector(p0,p1)|Vector(p0,p2);
	if(0<c)
	{
		printf("COUNTER_CLOCKWISE\n");
		return;
	}
	if(c<0)
	{
		printf("CLOCKWISE\n");
		return;
	}
	if(p0.x==p1.x&&p0.y==p1.y)
	{
		printf("ONLINE_FRONT\n");
		return;
	}
	if(p0.x==p2.x&&p0.y==p2.y)
	{
		printf("ON_SEGMENT\n");
		return;
	}
	if((p1.x<p0.x)^(p2.x<=p0.x)&&(p1.y<p0.y)^(p2.y<=p0.y))
	{
		printf("ONLINE_BACK\n");
		return;
	}
	double dis1=p0==p1;
	double dis2=p0==p2;
	if(dis1<dis2)
	{
		printf("ONLINE_FRONT\n");
		return;
	}
	printf("ON_SEGMENT\n");
}
int main()
{
	p0.Read();
	p1.Read();
	int q;
	scanf("%d",&q);
	REP(i,1,q)
	{
		Work();
	}
	return 0;
}
