<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>
using namespace std;
namespace LCY{
	#define double long double
	const double EPS=1e-10;
	inline int dcmp(double x){if(fabs(x)<EPS)return 0;return (x<0)?-1:1;}
	struct Point{double x,y;Point(double _x=0,double _y=0){x=_x;y=_y;}};
	struct Vector{double x,y;Vector(double _x=0,double _y=0){x=_x;y=_y;}};
	
	Vector operator - (Point a,Point b){return Vector(a.x-b.x,a.y-b.y);}
	Vector operator * (Vector a,double d){return Vector(a.x*d,a.y*d);}
	Point operator + (Point a,Vector b){return Point(a.x+b.x,a.y+b.y);}
	
	inline double dot(Vector a,Vector b){return a.x*b.x+a.y*b.y;}
	inline double cross(Vector a,Vector b){return a.x*b.y-a.y*b.x;}
	inline double norm(Vector a){return dot(a,a);}
	
	struct Line{
		Point p1,p2;
		Line(Point _p1=Point(0,0),Point _p2=Point(0,0)){p1=_p1;p2=_p2;}
	};
	
	Point project(Line l,Point p){
		Vector base=l.p2-l.p1;
		double r=dot(p-l.p1,base)/norm(base);
		return l.p1+base*r;
	}
	Point reflect(Line l,Point p){
		Point q=project(l,p);
		Vector v=p-q;v.x=-v.x;v.y=-v.y;
		return q+v;
	}
	string ccw(Vector v1,Vector v2){
		if(dcmp(cross(v1,v2))>0)return "COUNTER_CLOCKWISE";//return 1;
		else if(dcmp(cross(v1,v2))<0)return "CLOCKWISE";//return 2;
		else{
			if(dcmp(dot(v1,v2))<0)return "ONLINE_BACK";//return 3;
			else{
				if(dcmp(norm(v1)-norm(v2))<0)return "ONLINE_FRONT";//return 4;
				else return "ON_SEGMENT";//return 5;
			}
		}
	}
}
using namespace LCY;
int main(){
	Point p0,p1,p2;int n;cin>>p0.x>>p0.y>>p1.x>>p1.y>>n;while(n--){
		cin>>p2.x>>p2.y;
		cout<<ccw(p1-p0,p2-p0)<<endl;
	}
	return 0;
}
