#include <cstdio>
#include <iostream>
#include <complex>
#include <vector>
#include <cmath>
#include <cassert>
#define rep(i,n) for(int i=0;i<n;i++)
#define fs first
#define sc second
#define pb push_back
using namespace std;
typedef double D;
typedef complex<D> P;
typedef pair<P,P> L;		//fs->sc
typedef vector<P> Pol;
struct C{P p;D r;};
D inf=1e50,eps=1e-10;
//template<class T> bool eq(T a, T b) { return abs(a-b)<eps;}
//template<class T> int sig(T a) { return eq(a,0) ? 0 : (a>0 ? 1 : -1);}
bool eq(D a, D b) { return abs(a-b)<eps;}
int sig(D a) { return eq(a,0) ? 0 : (a>0 ? 1 : -1);}
inline D dot(P a, P b) { return real(conj(a)*b);};
inline D cro(P a, P b) { return imag(conj(a)*b);};
enum ENCCW{CCW=1, CW=-1, FRONT=2, BACK=-2, ON=0};	//!!MAEHARAとFRONT,BACKが逆
//ON優先(including endpoint)
inline int ccw (P a, P b, P c){
//	cout << cro(b-a,c-a) << endl;
	if(sig(cro(b-a,c-a))==1) return CCW;
	if(sig(cro(b-a,c-a))==-1) return CW;
	if(eq(abs(a-c)+abs(c-b),abs(a-b))) return ON;
	if(eq(abs(a-b)+abs(b-c),abs(a-c))) return FRONT;
	if(eq(abs(c-a)+abs(a-b),abs(c-b))) return BACK;
	assert(false);
}
inline P proj(P a, P b){		//ベクトルaのbへの射影
	return (dot(a,b)/norm(b))*b;
}
inline P perp(L l, P p){		//垂線の足
	D t=dot(p-l.fs,l.fs-l.sc)/norm(l.fs-l.sc);
	return l.fs+t*(l.fs-l.sc);
}
inline P refl(L l, P p){
	return p+2.0*(perp(l,p)-p);
}
inline bool ispal(L a, L b){
	return sig(cro(a.fs-a.sc,b.fs-b.sc))==0;
}
inline bool ovLL(L a, L b){
	return ispal(a,b) && sig(cro(a.fs-a.sc,b.fs-a.sc))==0;
}
inline bool iLL(L a, L b){		//intersect or overload
	return !ispal(a,b) || ovLL(a,b);
}
inline bool iLS(L l, L s){		//intersect(including endpoint) or overload
	return cro(l.sc-l.fs,s.fs-l.fs)*cro(l.sc-l.fs,s.sc-l.fs)<eps;
}
inline bool iLP(L l, P p){		//on line
	return sig(cro(l.sc-p,l.fs-p));
}
inline bool iSS(L a, L b){		//intersect(including endpoint) or overload
	return ccw(a.fs,a.sc,b.fs)*ccw(a.fs,a.sc,b.sc)<=0 && ccw(b.fs,b.sc,a.fs)*ccw(b.fs,b.sc,a.sc)<=0;
}
inline bool iSP(L s, P p){		//intersect(including endpoint) or overload
	return ccw(s.fs,p,s.sc)==ON;
}
inline D dLP(L l, P p) { return abs(perp(l,p)-p);}
inline D dLL(L a, L b) { return iLL(a,b) ? 0 : dLP(a,b.fs);}
inline D dLS(L l, L s) { return iLS(l,s) ? 0 : min(dLP(l,s.fs),dLP(l,s.sc));}
inline D dSP(L s, P p) {
	P q=perp(s,p);
	return iSP(s,q) ? abs(p-q) : min(abs(p-s.fs),abs(p-s.sc));
}
inline D dSS(L a, L b) {
	if(iSS(a,b)) return 0;
	return min(min(dSP(a,b.fs),dSP(a,b.sc)),min(dSP(b,a.fs),dSP(b,a.sc)));
}
inline P intLL(L a, L b) {	//intersection
	assert(!ispal(a,b));
	D t=cro(a.sc-a.fs,a.sc-b.fs)/cro(a.sc-a.fs,b.sc-b.fs);
	return b.fs+t*(b.sc-b.fs);
}
enum ENICP{INC=1,ONC=0,OUTC=-1};
inline int iCP(C c, P p){
	D d=abs(p-c.p);
	return eq(d,c.r) ? ONC : (d<c.r ? INC : OUTC);
}
inline int iCL(C c, L l){		//num of intersection(s)
	D d=dLP(l,c.p);
	return eq(d,c.r) ? 1 : (d<c.r ? 2 : 0);
}
//inline int iCS
//inline int iCC(C a, C b){

/*inline P intCL1(C c, L l){		//iCL=1
	assert(iCL(c,l)==1);
}
inline L intCL2(C c, L l){		//iCL=2
	assert(iCL(c,l)==2);
}*/
D aTri(P a, P b, P c){ return cro(b-a,c-a)/2;}
D aPol(Pol p){			//点集合はCCWに与える
	int n=p.size();
	D ret=0;
	rep(i,n) ret+=cro(p[i],p[(i+1)%n])/2;
	return ret;
}
P gPol(Pol p){			//多角形内部が一様な重さを持つときの重心
	int n=p.size();
	P g;
	D s=aPol(p);
	assert(s>eps);
	rep(i,n){
		D ds=cro(p[i],p[(i+1)%n])/2;
		g+=ds/3*(p[i]+p[(i+1)%n]);
	}
	return g/s;
}
enum ENCONT{INP=1,ONP=0,OUTP=-1};
int contain(Pol pol, P p){
	bool in=false;
	rep(i,pol.size()){
		P a=pol[i],b=pol[(i+1)%pol.size()];
		if(ccw(a,b,p)==ON) return ONP;
		if(!iLS(L(p,p+1.),L(a,b))) continue;
		if(ovLL(L(p,p+1.),L(a,b))){
			if(sig(max(real(a),real(b))-real(p))>=0) in=!in;
			continue;
		}
		if(sig(real(intLL(L(p,p+1.),L(a,b)))-real(p))>=0) in=!in;
	}
	return in ? INP : OUTP;
}
inline D heron(D a, D b, D c){
	double s=(a+b+c)/2;
	if(s-a<eps || s-b<eps || s-c<eps) return 0;		//S=0 || 三角形できない
	return sqrt(s*(s-a)*(s-b)*(s-c));
}
int main(){
	D x0,y0,x1,y1;
	cin >> x0 >> y0 >> x1 >> y1;
	P a=P(x0,y0), b=P(x1,y1);
	int q;
	scanf("%d",&q);
	rep(i,q){
		D x,y;
		scanf("%lf%lf",&x,&y);
		int k=ccw(a,b,P(x,y));
		if(k==CCW) printf("COUNTER_CLOCKWISE\n");
		if(k==CW) printf("CLOCKWISE\n");
		if(k==FRONT) printf("ONLINE_FRONT\n");
		if(k==BACK) printf("ONLINE_BACK\n");
		if(k==ON) printf("ON_SEGMENT\n");

	}
	return 0;
}

Measured memory_bytes: 1272