<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;
using ll = long long;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define br() p("")
#define p(s) cout<<(s)<<endl
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("Yes")
#define p_no() p("No")

const ll mod = 1e9 + 7;
const ll inf = 1e18;

// 複素数雨セット
typedef complex<double> C;
// 内積
double dot(C a, C b){
    return a.real() * b.real() + a.imag() * b.imag();
}
// 外積
double cross(C a, C b){
    return a.real() * b.imag() - a.imag() * b.real();
}
double round(double a){
    if(abs(a) < 0.00000000001){
        return 0;
    }
    else{
        return a;
    }
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    // input
    ll x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;

    C p0(x1, y1);
    C p1(x2, y2);
    C v = p1 - p0;
        
    ll Q; cin >> Q;
    while(Q--){
        ll x, y;
        cin >> x >> y;
        C p2(x, y);
        C w = p2 - p0;

        double a = cross(v, w);
        a = round(a);

        if(a>0){
            p("COUNTER_CLOCKWISE");
        }
        else if(a<0){
            p("CLOCKWISE");
        }else{
            double d = dot(v, w);
            if(d<0){
                p("ONLINE_BACK");
            }
            else{
                if(abs(w)>abs(v)){
                    p("ONLINE_FRONT");
                }else{
                    p("ON_SEGMENT");
                }
            }
        }
    }
    
    return 0;
}
