<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 <algorithm>
#include <complex>
#include <vector>
using namespace std;
const double eps = 1e-10;
#define EQ(a, b) (abs((a) - (b)) < eps)
using P = complex<double>;      // position
struct L : vector<P> {
    L(const P &a = P(), const P &b = P()) {
        emplace_back(a); emplace_back(b);
    }
};
double dot(const P &a, const P &b) { return real(conj(a) * b); }
double cross(const P &a, const P &b) { return imag(conj(a) * b); }

enum CCW_RESULT { CCW = +1, CW = -1, BEHIND = +2, FRONT = -2, ON = 0 };
int ccw(P a, P b, P c) {
    b -= a; c -= a;
    if (cross(b, c) > eps) return CCW;      // counter clockwise
    if (cross(b, c) < -eps) return CW;      // clockwise
    if (dot(b, c) < 0) return BEHIND;       // c--a--b on line
    if (norm(b) < norm(c)) return FRONT;    // a--b--c on line | a=b
    return ON;                              // on segment | a=c | b=c
}

#include <iostream>
#include <iomanip>
enum {
    COUNTER_CLOCKWISE = 1, CLOCKWISE = -1,
    ONLINE_BACK = 2, ONLINE_FRONT = -2, ON_SEGMENT = 0
};
int main() {
    cout << fixed << setprecision(10);
    int a, b, c, d; cin >> a >> b >> c >> d;
    P p1(a, b), p2(c, d);
    int q; cin >> q;
    while (q--) {
        int x, y; cin >> x >> y;
        int res = ccw(p1, p2, P(x, y));
        if (res == COUNTER_CLOCKWISE) cout << "COUNTER_CLOCKWISE" << endl;
        if (res == CLOCKWISE) cout << "CLOCKWISE" << endl;
        if (res == ONLINE_BACK) cout << "ONLINE_BACK" << endl;
        if (res == ONLINE_FRONT) cout << "ONLINE_FRONT" << endl;
        if (res == ON_SEGMENT) cout << "ON_SEGMENT" << endl;
    }
    return 0;
}
