<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<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf = 0x3f3f3f3f;
#define dbg(x...) do { cout << "\033[32;1m" << #x <<" -> "; err(x); } while (0)
void err() { cout << "\033[39;0m" << endl; }
template<class T, class... Ts> void err(const T& arg,const Ts&... args) { cout << arg << " "; err(args...); }
typedef long double db;
const db eps = 1e-12;
const db pi = acosl(-1.0);
inline int sgn(db x) {if(fabs(x) < eps) return 0; return x < 0 ? -1 : 1;}

struct Point{
    db x, y;
    Point(){}
    Point(db x, db y):x(x), y(y){}
    void input(){
        cin >> x >> y;
    }
    Point operator - (const Point &b) const{
        return Point(x - b.x, y - b.y);
    }
    db operator ^ (const Point &b)const {
        return x * b.y - y * b.x;
    }
    db operator * (const Point &b) const{
        return x * b.x + y * b.y;
    }
}p0, p1, p2;


int main(){
#ifndef ONLINE_JUDGE
// freopen("i.in","r",stdin);
//  freopen("o.out","w",stdout);
#endif
    p0.input(); p1.input();
    int q;scanf("%d", &q);
    while(q--){
        p2.input();
        int d1 = sgn((p2 - p0) ^ (p1 - p0));
        if(d1 < 0) puts("COUNTER_CLOCKWISE");
        else if(d1 > 0) puts("CLOCKWISE");
        else {
            int d2 = sgn((p2 - p0) * (p1 - p0));
            if(d2 < 0) puts("ONLINE_BACK");
            else if(sgn((p2 - p1) * (p1 - p0)) > 0) puts("ONLINE_FRONT");
            else puts("ON_SEGMENT");
        }
        
    }

    return 0;
}
