#define PROBLEM "https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_1_C"
#include"template/template.hpp"
#include"geometry/geometry-base.hpp"intmain(){Pointa,b;in(a,b);intq;in(q);constarray<string,5>ans={"ONLINE_FRONT","CLOCKWISE","ON_SEGMENT","COUNTER_CLOCKWISE","ONLINE_BACK"};while(q--){Pointc;in(c);out(ans[ccw(a,b,c)+2]);}}
#line 1 "verify/geometry/AOJ_CGL_1_C.test.cpp"
#define PROBLEM "https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=CGL_1_C"
#line 2 "template/template.hpp"
#include<bits/stdc++.h>usingnamespacestd;#line 2 "template/macro.hpp"
#define rep(i, a, b) for (int i = (a); i < (int)(b); i++)
#define rrep(i, a, b) for (int i = (int)(b) - 1; i >= (a); i--)
#define ALL(v) (v).begin(), (v).end()
#define UNIQUE(v) sort(ALL(v)), (v).erase(unique(ALL(v)), (v).end())
#define SZ(v) (int)v.size()
#define MIN(v) *min_element(ALL(v))
#define MAX(v) *max_element(ALL(v))
#define LB(v, x) int(lower_bound(ALL(v), (x)) - (v).begin())
#define UB(v, x) int(upper_bound(ALL(v), (x)) - (v).begin())
#define YN(b) cout << ((b) ? "YES" : "NO") << "\n";
#define Yn(b) cout << ((b) ? "Yes" : "No") << "\n";
#define yn(b) cout << ((b) ? "yes" : "no") << "\n";
#line 6 "template/template.hpp"
#line 2 "template/util.hpp"
usinguint=unsignedint;usingll=longlongint;usingull=unsignedlonglong;usingi128=__int128_t;usingu128=__uint128_t;template<classT>usingpriority_queue_asc=priority_queue<T,vector<T>,greater<T>>;template<classT,classS=T>SSUM(constvector<T>&a){returnaccumulate(ALL(a),S(0));}template<classT1,classT2>inlineboolchmin(T1&a,T2b){if(a>b){a=b;returntrue;}returnfalse;}template<classT1,classT2>inlineboolchmax(T1&a,T2b){if(a<b){a=b;returntrue;}returnfalse;}template<classT1,classT2>inlineboolchmin_opt(optional<T1>&a,T2b){if(!a||a>b){a=b;returntrue;}returnfalse;}template<classT1,classT2>inlineboolchmax_opt(optional<T1>&a,T2b){if(!a||a<b){a=b;returntrue;}returnfalse;}template<classT>intpopcnt(Tx){return__builtin_popcountll(x);}template<classT>inttopbit(Tx){return(x==0?-1:63-__builtin_clzll(x));}template<classT>intlowbit(Tx){return(x==0?-1:__builtin_ctzll(x));}#line 8 "template/template.hpp"
#line 2 "template/inout.hpp"
structFast{Fast(){cin.tie(nullptr);ios_base::sync_with_stdio(false);cout<<fixed<<setprecision(15);}}fast;ostream&operator<<(ostream&os,__uint128_tx){charbuf[40];size_tk=0;while(x>0)buf[k++]=(char)(x%10+'0'),x/=10;if(k==0)buf[k++]='0';while(k)os<<buf[--k];returnos;}ostream&operator<<(ostream&os,__int128_tx){returnx<0?(os<<'-'<<(__uint128_t)(-x)):(os<<(__uint128_t)x);}template<classT,size_tN>ostream&operator<<(ostream&os,constarray<T,N>&a);template<classT1,classT2>istream&operator>>(istream&is,pair<T1,T2>&p){returnis>>p.first>>p.second;}template<classT1,classT2>ostream&operator<<(ostream&os,constpair<T1,T2>&p){returnos<<p.first<<" "<<p.second;}template<classT>istream&operator>>(istream&is,vector<T>&a){for(auto&v:a)is>>v;returnis;}template<classT>ostream&operator<<(ostream&os,constvector<T>&a){for(autoit=a.begin();it!=a.end();){os<<*it;if(++it!=a.end())os<<" ";}returnos;}template<classT,size_tN>ostream&operator<<(ostream&os,constarray<T,N>&a){for(autoit=a.begin();it!=a.end();){os<<*it;if(++it!=a.end())os<<" ";}returnos;}template<classT>ostream&operator<<(ostream&os,constset<T>&st){os<<"{";for(autoit=st.begin();it!=st.end();){os<<*it;if(++it!=st.end())os<<",";}os<<"}";returnos;}template<classT1,classT2>ostream&operator<<(ostream&os,constmap<T1,T2>&mp){os<<"{";for(autoit=mp.begin();it!=mp.end();){os<<it->first<<":"<<it->second;if(++it!=mp.end())os<<",";}os<<"}";returnos;}voidin(){}template<typenameT,class...U>voidin(T&t,U&...u){cin>>t;in(u...);}template<class...T>voidin_zip(intn,T&...t){assert(n>=0&&((size(t)>=static_cast<size_t>(n))&&...));for(inti=0;i<n;i++)in(t[i]...);}voidout(){cout<<"\n";}template<typenameT,class...U,charsep=' '>voidout(constT&t,constU&...u){cout<<t;if(sizeof...(u))cout<<sep;out(u...);}template<classT,classU>voidout_opt(constoptional<T>&opt,constU&fallback,ostream&os=cout){if(opt.has_value())os<<opt.value();elseos<<fallback;os<<"\n";}template<classT,classU>voidout_opt(constvector<optional<T>>&vec,constU&fallback,ostream&os=cout){for(autoit=vec.begin();it!=vec.end();){if((*it).has_value())os<<(*it).value();elseos<<fallback;if(++it!=vec.end())os<<" ";}os<<"\n";}namespaceIO{template<classT,class...U>Tread(U&&...u){Tt=T(forward<U>(u)...);in(t);returnt;}namespaceGraph{vector<vector<int>>unweighted(intn,intm,booldirected=false,intoffset=1){vector<vector<int>>g(n);for(inti=0;i<m;i++){intu,v;cin>>u>>v;u-=offset,v-=offset;g[u].push_back(v);if(!directed)g[v].push_back(u);}returng;}template<classT>vector<vector<pair<int,T>>>weighted(intn,intm,booldirected=false,intoffset=1){vector<vector<pair<int,T>>>g(n);for(inti=0;i<m;i++){intu,v;Tw;cin>>u>>v>>w;u-=offset,v-=offset;g[u].push_back({v,w});if(!directed)g[v].push_back({u,w});}returng;}}// namespace GraphnamespaceTree{vector<vector<int>>unweighted(intn,booldirected=false,intoffset=1){returnGraph::unweighted(n,n-1,directed,offset);}template<classT>vector<vector<pair<int,T>>>weighted(intn,booldirected=false,intoffset=1){returnGraph::weighted<T>(n,n-1,directed,offset);}vector<vector<int>>rooted(intn,boolto_root=true,boolto_leaf=true,intoffset=1){vector<vector<int>>g(n);for(inti=1;i<n;i++){intp;cin>>p;p-=offset;if(to_root)g[i].push_back(p);if(to_leaf)g[p].push_back(i);}returng;}}// namespace Tree}// namespace IO#line 10 "template/template.hpp"
#line 2 "template/debug.hpp"
#ifdef LOCAL
#define debug 1
#define show(...) _show(0, #__VA_ARGS__, __VA_ARGS__)
#else
#define debug 0
#define show(...) true
#endif
template<classT>void_show(int,T){cerr<<'\n';}template<classT1,classT2,class...T3>void_show(inti,constT1&a,constT2&b,constT3&...c){for(;a[i]!=','&&a[i]!='\0';i++)cerr<<a[i];cerr<<":"<<b<<" ";_show(i+1,a,c...);}#line 2 "geometry/geometry-base.hpp"
#line 4 "geometry/geometry-base.hpp"
usingReal=longdouble;constexprRealEPS=1e-10;constexprRealPI=3.141592653589793238462643383279L;boolequals(Realx,Realy){returnfabs(x-y)<EPS;}intsign(Reala){returnequals(a,0)?0:(a>0?1:-1);}template<classR>structPointBase{usingP=PointBase;Rx,y;PointBase():x(0),y(0){}PointBase(R_x,R_y):x(_x),y(_y){}template<typenameT,typenameU>PointBase(constpair<T,U>&p):x(p.first),y(p.second){}Poperator+(constP&r)const{returnP{x+r.x,y+r.y};}Poperator-(constP&r)const{returnP{x-r.x,y-r.y};}Poperator-()const{returnP{-x,-y};}Poperator*(Rr)const{returnP{x*r,y*r};}Poperator/(Rr)const{returnP{x/r,y/r};}P&operator+=(constP&r){return(*this)=(*this)+r;}P&operator-=(constP&r){return(*this)=(*this)-r;}P&operator*=(Rr){return(*this)=(*this)*r;}P&operator/=(Rr){return(*this)=(*this)/r;}booloperator<(constP&r)const{returnx!=r.x?x<r.x:y<r.y;}booloperator==(constP&r)const{returnx==r.xandy==r.y;}booloperator!=(constP&r)const{return!((*this)==r);}Protate(Rrad)const{return{x*cos(rad)-y*sin(rad),x*sin(rad)+y*cos(rad)};}Protate90()const{return{-y,x};}Rreal()const{returnx;}Rimag()const{returny;}friendPoperator*(Rr,constP&p){returnp*r;}friendRreal(constP&p){returnp.x;}friendRimag(constP&p){returnp.y;}friendRdot(constP&l,constP&r){returnl.x*r.x+l.y*r.y;}friendRcross(constP&l,constP&r){returnl.x*r.y-l.y*r.x;}friendRabs(constP&p){returnsqrt(p.x*p.x+p.y*p.y);}friendRnorm(constP&p){returnp.x*p.x+p.y*p.y;}friendRarg(constP&p){returnatan2(p.y,p.x);}friendistream&operator>>(istream&is,P&p){Ra,b;is>>a>>b;p=P{a,b};returnis;}friendostream&operator<<(ostream&os,constP&p){returnos<<p.x<<" "<<p.y;}};usingPoint=PointBase<Real>;usingPoints=vector<Point>;// relative position of c from a->bintccw(constPoint&a,constPoint&b,constPoint&c){Pointx=b-a,y=c-a;if(cross(x,y)>EPS)return+1;// counter-clockwiseif(cross(x,y)<-EPS)return-1;// clockwiseif(dot(x,y)<-EPS)return+2;// collinear in the order c-a-bif(norm(x)+EPS<norm(y))return-2;// collinear in the order a-b-creturn0;// collinear in the order a-c-b}/**
* @brief 二次元幾何の基本要素
* @docs docs/geometry/geometry-base.md
*/#line 5 "verify/geometry/AOJ_CGL_1_C.test.cpp"
intmain(){Pointa,b;in(a,b);intq;in(q);constarray<string,5>ans={"ONLINE_FRONT","CLOCKWISE","ON_SEGMENT","COUNTER_CLOCKWISE","ONLINE_BACK"};while(q--){Pointc;in(c);out(ans[ccw(a,b,c)+2]);}}