<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 <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
const double EPS = 1e-7;
const double INF = 1e12;
struct Vec {
    double x,y;
    Vec(){}
    Vec(double x,double y){ this->x=x,this->y=y; }
    void read(){ scanf("%lf%lf",&x,&y); }
    void prt() {printf("%.9f %.9f\n",x,y); }
    double len(){ return sqrt(x*x+y*y); }
    double len2(){ return x*x+y*y; }
    
    Vec operator+(const Vec&o)const{ return Vec(x+o.x,y+o.y); }
    Vec operator-(const Vec&o)const{ return Vec(x-o.x,y-o.y); }
    Vec operator*(const double&k)const{ return Vec(k*x,k*y); }
    double operator*(const Vec&o)const {return x*o.x+y*o.y; }
    double operator^(const Vec&o)const {return x*o.y-y*o.x; }
    Vec rotate(double ang){ return Vec(x*cos(ang)-y*sin(ang), x*sin(ang)+y*cos(ang)); }
    Vec change(double l){ if(len()<EPS) return *this; return (*this)*(l/len()); }
    double disToLine(Vec A, Vec B) {
        return abs((A-*this)^(B-*this))/(B-A).len();
    }
};

Vec Lineintersect(Vec A1,Vec A2,Vec B1,Vec B2) {
    if (abs((A2-A1)^(B2-B1)) < EPS) return Vec(INF,INF);
    return A1 + (A2 - A1) * ((abs((A2-A1)^(B2-B1)) - abs((A2-B1)^(B2-B1)) ) / abs((A2-A1)^(B2-B1)));
}

Vec Segintersect(Vec A1,Vec A2,Vec B1,Vec B2) {
    Vec P = Lineintersect(A1,A2,B1,B2);
    if ((P-A1)*(P-A2)<=0 && (P-B1)*(P-B2)<=0) return P; 
    return Vec(INF,INF);
}

Vec p1,p2;
int main(){
    p1.read(); p2.read();
    int q; scanf("%d",&q);
    while(q--){
        Vec p; p.read();
        if(((p2-p1)^(p-p1))>0)
            printf("COUNTER_CLOCKWISE\n");
        else if(((p2-p1)^(p-p1))<0)
            printf("CLOCKWISE\n");
        else {
            if((p-p1)*(p-p2)<=0)
                printf("ON_SEGMENT\n");
            else if((p-p1).len() < (p-p2).len())
                printf("ONLINE_BACK\n");
            else 
                printf("ONLINE_FRONT\n");
        }
    }
}
