#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cassert>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define rep(i,n) FOR(i,0,n)
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define vint vector<int>
#define vdouble vector<double>
#define vstring vector<string>
using namespace std;

#include<map>
#include<set>
#include<queue>

typedef long long ll;
typedef unsigned long long ull;

const int MAX_N = 1000000;
const int INFTY = (1 << 21); // 2097152
// const ll INFTY = (1LL << 60);

#define EPS (1e-10)
#define equals(a, b) (fabs((a)-(b)) < EPS)

class Point{
public:
	double x, y;
	Point(double x=0, double y=0):x(x), y(y){}

	Point operator + (Point p){ return Point(x + p.x, y + p.y); }
	Point operator - (Point p){ return Point(x - p.x, y - p.y); }
	Point operator * (double a){ return Point(a * x, a * y); }
	Point operator / (double a){ return Point(x / a, y / a); }

	double abs() { return sqrt(norm()); }
	double norm() { return x * x + y * y;}
	bool operator < (const Point &p) const {
		// first x, second y
		return x != p.x ? x < p.x : y < p.y;
	}

	bool operator == (const Point &p) const{
		return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS;
	}
};

typedef Point Vector;

struct Segment{
public:
	Point p1, p2;
	Segment(Point p1, Point p2){
		this->p1 = p1;
		this->p2 = p2;
	}
};

double dot(Vector a, Vector b){
	//|a||b|cos(theta)
	return a.x * b.x + a.y * b.y;
}
double cross(Vector a, Vector b){
	//|a||b|cos(theta)
	return a.x * b.y - a.y * b.x;
}

// Orthogonal
bool isOrthogonal(Vector a, Vector b){
	return equals(dot(a, b), 0.0);
}
bool isOrthogonal(Point a1, Point a2, Point b1, Point b2){
	return isOrthogonal(a1 - a2, b1- b2);
}

// Orthogonal
bool isParallel(Vector a, Vector b){
	return equals(cross(a, b), 0.0);
}
bool isParallel(Point a1, Point a2, Point b1, Point b2){
	return isParallel(a1 - a2, b1- b2);
}

// ???p????????????s???????????????????????????
Point project(Segment s, Point p){
	// ??\??????????????????
	// hypo -> p - p1, base -> p2 - p1
	// t = |hypo|cos??
	// cos?? = dot(hypo,base)/|hypo||base|
	// project = s.p1 + base/|base| * t
	Vector hypo = p - s.p1;
	Vector base = s.p2 - s.p1;
	double r = dot(hypo, base) / base.norm();
	return s.p1 + base * r;
}

// ???p????????????s???????§°?????¨?????????
Point reflection(Segment s, Point p){
	Point pr = project(s, p);
	return p + (pr - p) * 2.0;
}

static const int COUNTER_CLOCKWISE = 1;
static const int CLOCKWISE = -1;
static const int ONLINE_BACK = 2;
static const int ONLINE_FRONT = -2;
static const int ON_SEGMENT = 0;

// p0??????p1????????????????????????????????????p2?????????
int ccw(Point p0, Point p1, Point p2){
	Vector a = p1 - p0;
	Vector b = p2 - p0;
	if( cross(a, b) > EPS) return COUNTER_CLOCKWISE;
	if( cross(a, b) < -EPS) return CLOCKWISE;
	if (dot(a,b) <-EPS) return ONLINE_BACK;
	if (a.norm() < b.norm()) return ONLINE_FRONT;
	return ON_SEGMENT;
}

// ???????????¢
double distance(Point a, Point b){
	return (a - b).abs();
}

// ?????¨??´???????????¢
double distanceLinePoint(Segment s, Point p){
	// sin?? = |cross(hypo, base)|/|hypo||base|
	// distance = |hypo|sin?? = |cross(hypo, base)|/|base|
	Vector hypo = p - s.p1;
	Vector base = s.p2 - s.p1;
	return abs(cross(hypo, base)) / base.abs();
}

// ?????¨??????????????¢
double distanceSegmentPoint(Segment s, Point p){
	// (p2-p1)??¨???p-p1??????90???????????§????????´??????p??¨p1????????¢
	// (p1-p2)??¨???p-p2??????90???????????§????????´??????p??¨p2????????¢
	// ????????\????????´???????????¨??´???????????¢
	if(dot(s.p2-s.p1, p-s.p1) < 0.0) return (p - s.p1).abs();
	if(dot(s.p1-s.p2, p-s.p2) < 0.0) return (p - s.p2).abs();
	return distanceLinePoint(s, p);
}

// ????????¨??????????????¢
// TODO

int Q;

int main() {
	Point p0, p1;
	cin >> p0.x >> p0.y >> p1.x >> p1.y;

	cin >> Q;
	rep(i, Q){

		Point p2;
		cin >> p2.x >> p2.y;
		int c = ccw(p0, p1, p2);
		if(c == COUNTER_CLOCKWISE) cout << "COUNTER_CLOCKWISE" << endl;
		if(c == CLOCKWISE) cout << "CLOCKWISE" << endl;
		if(c == ONLINE_BACK) cout << "ONLINE_BACK" << endl;
		if(c == ONLINE_FRONT) cout << "ONLINE_FRONT" << endl;
		if(c == ON_SEGMENT) cout << "ON_SEGMENT" << endl;
	}
}

Measured memory_bytes: 3220