<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 UL = unsigned int;
using ULL = unsigned long long;
using LL = long long;
#define rep(i,n) for(UL i=0; i<(n); i++)

bool dblsame(double l, double r) {return abs(l-r) < abs(l) * 1e-10 + 1e-10;}

struct Vec{
 double x,y;
 Vec(double xx, double yy) : x(xx),y(yy) {}
 Vec operator+() const {return Vec(x,y);}
 Vec operator-() const {return Vec(-x,-y);}
 Vec operator+(const Vec& r) const {return Vec(x+r.x,y+r.y);}
 Vec operator-(const Vec& r) const {return Vec(x-r.x,y-r.y);}
 Vec operator*(double r) const {return Vec(x*r,y*r);}
 Vec operator/(double r) const {return Vec(x/r,y/r);}
 Vec& operator+=(const Vec& r) {*this=*this+r; return *this;}
 Vec& operator-=(const Vec& r) {*this=*this-r; return *this;}
 Vec& operator*=(double r) {*this=*this*r; return *this;}
 Vec& operator/=(double r) {*this=*this/r; return *this;}
 bool operator==(const Vec& r) const {return dblsame(x,r.x)&&dblsame(y,r.y);}
 bool operator!=(const Vec& r) const {return !(*this==r);} 
 double operator*(const Vec& r) const {return x*r.x+y*r.y;}
 double abs() const {return sqrt(x*x+y*y);}
 double abs_squared() const {return x*x+y*y;}
 double product(const Vec& r) const {return x*r.y-y*r.x;}
};

Vec InputVec(){
 double x,y; scanf("%lf%lf",&x,&y);
 return Vec(x,y);
}

void PrintVec(Vec tg){
 printf("%.10f %.10f",tg.x,tg.y);
}

int main() {
 Vec O = InputVec();
 Vec A = InputVec() - O;
 UL Q; scanf("%u",&Q);
 rep(q,Q){
  Vec B = InputVec() - O;
  double p = A.product(B);
  if(dblsame(p,0.0)){
   double dot = A*B;
   if(dot<0.0) printf("ONLINE_BACK\n");
   else if(B.abs()>A.abs()) printf("ONLINE_FRONT\n");
   else printf("ON_SEGMENT\n");
  }
  else{
   if(p>0.0) printf("COUNTER_CLOCKWISE\n");
   else printf("CLOCKWISE\n");
  }
  printf("\n");
 }
 return 0;
}

