#include<algorithm>
#include<cmath>

// double
const double EPS = 1e-9;
double relative_error(double d1, double d2) {return (d1 - d2) / std::max({d1, d2, EPS});}

// Point
enum POSITION {ONLINE_FRONT = -2, CLOCKWISE, ON_SEGMENT, COUNTER_CLOCKWISE, ONLINE_BACK};

class Point {
    double x_, y_;
public:
    Point(double d = 0.0);
    Point(double x, double y);
    double x() const;
    double y() const;
    double x(double d);
    double y(double d);
    const Point operator-() const;
    const Point& operator=(const Point& p);
    const Point& operator+=(const Point& p);
    const Point& operator-=(const Point& p);
    const Point& operator*=(const Point& p);
    const Point& operator/=(const Point& p);
    double abs() const;
    double norm() const;
    double dot(const Point& p) const;
    double cross(const Point& p) const;
    double distance(const Point& p) const;
};

bool operator==(const Point& lhs, const Point& rhs) {return lhs.x() == rhs.x() && lhs.y() == rhs.y();}
bool operator<(const Point& lhs, const Point& rhs) {return lhs.x() != rhs.x() ? lhs.x() < rhs.x() : lhs.y() < rhs.y();}
bool operator<=(const Point& lhs, const Point& rhs) {return lhs.x() != rhs.x() ? lhs.x() < rhs.x() : lhs.y() <= rhs.y();}
bool operator!=(const Point& lhs, const Point& rhs) {return !(lhs == rhs);}
bool operator>(const Point& lhs, const Point& rhs) {return !(lhs <= rhs);}
bool operator>=(const Point& lhs, const Point& rhs) {return !(lhs < rhs);}
const Point operator+(const Point& lhs, const Point& rhs) {return Point(lhs.x() + rhs.x(), lhs.y() + rhs.y());}
const Point operator-(const Point& lhs, const Point& rhs) {return Point(lhs.x() - rhs.x(), lhs.y() - rhs.y());}
const Point operator*(const Point& lhs, const Point& rhs) {return Point(lhs.x() * rhs.x(), lhs.y() * rhs.y());}
const Point operator/(const Point& lhs, const Point& rhs) {return Point(lhs.x() / rhs.x(), lhs.y() / rhs.y());}

Point::Point(double d) :x_(d), y_(d) {}
Point::Point(double x, double y) :x_(x), y_(y) {}
double Point::x() const {return x_;}
double Point::y() const {return y_;}
double Point::x(double d) {return x_ = d;}
double Point::y(double d) {return y_ = d;}
const Point Point::operator-() const {return Point(-x(), -y());}
const Point& Point::operator=(const Point& p) {x(p.x()); y(p.y()); return *this;}
const Point& Point::operator+=(const Point& p) {return *this = *this + p;}
const Point& Point::operator-=(const Point& p) {return *this = *this - p;}
const Point& Point::operator*=(const Point& p) {return *this = *this * p;}
const Point& Point::operator/=(const Point& p) {return *this = *this / p;}
double Point::abs() const {return hypot(x(), y());}
double Point::norm() const {return x() * x() + y() * y();}
double Point::dot(const Point& p) const {return x() * p.x() + y() * p.y();}
double Point::cross(const Point& p) const {return x() * p.y() - y() * p.x();}
double Point::distance(const Point& p) const {return (*this - p).abs();}

POSITION ccw(const Point& a, const Point& b, const Point& c) {
    Point v1 = b - a;
    Point v2 = c - a;
    if(v1.cross(v2) > EPS) return COUNTER_CLOCKWISE;
    if(v1.cross(v2) < -EPS) return CLOCKWISE;
    if(v1.dot(v2) < -EPS) return ONLINE_BACK;
    if(v2.norm() - v1.norm() > EPS) return ONLINE_FRONT;
    return ON_SEGMENT;
}

////////////////////////////////////////////////////////////////////////////////
#include<iostream>
#include<vector>
using namespace std;

int main() {
    vector<Point> point(2);
    for(auto& p: point) {
        double x, y;
        cin >> x >> y;
        p = Point(x, y);
    }
    int q;
    for(cin >> q; q > 0; --q) {
        double x, y;
        cin >> x >> y;
        switch(ccw(point[0], point[1], Point(x, y))) {
        case COUNTER_CLOCKWISE:
            cout << "COUNTER_CLOCKWISE" << endl;
            break;
        case CLOCKWISE:
            cout << "CLOCKWISE" << endl;
            break;
        case ON_SEGMENT:
            cout << "ON_SEGMENT" << endl;
            break;
        case ONLINE_BACK:
            cout << "ONLINE_BACK" << endl;
            break;
        case ONLINE_FRONT:
            cout << "ONLINE_FRONT" << endl;
            break;
        }
    }
}

Measured memory_bytes: 1228