<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 {{{
#include <iostream>
#include <cassert>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <ctime>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <string>
#include <bitset>
#include <vector>
#include <complex>
#include <algorithm>
using namespace std;
// }}}
// #define {{{
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define de(x) cout << #x << "=" << x << endl
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
// }}}

typedef ll T;
struct P{
    T x,y;
    P(){} P(T x,T y):x(x),y(y){}
    P operator - (const P&b) const {return P(x-b.x,y-b.y);}
    T operator ^ (const P&b) const {return x*b.y-y*b.x;}
    T operator * (const P&b) const {return x*b.x+y*b.y;}
    void read() {scanf("%lld%lld",&x,&y);}
}s,t,p;
T norm(P a){return a*a;}

int main(){
    s.read();t.read();
    int Q;scanf("%d",&Q);
    rep(i,0,Q){
        p.read();
        int cross=(t-s)^(p-s),dot=(t-s)*(p-s);
        if(cross>0) puts("COUNTER_CLOCKWISE");
        else if(cross<0) puts("CLOCKWISE");
        else if(dot<0) puts("ONLINE_BACK");
        else if(norm(p-s)<=norm(t-s)) puts("ON_SEGMENT");
        else puts("ONLINE_FRONT");
    }
    return 0;
}