<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;

const int SIZE = 210;
const double eps = 1e-10;

typedef complex<double> P;

typedef double P_type;
typedef complex<P_type> P;
const P_type P_eps = 1e-8; //整数の時はゼロ

namespace std{
  template<class T> bool operator<(const complex<T> &a, const complex<T> &b){
    return a.real() == b.real() ? a.imag() < b.imag() : a.real() < b.real();
  }
};

P rotate(P p, double theta){
  return p * P(cos(theta), sin(theta));
}

//内積
double dot(P a, P b) {
  return (a * conj(b)).real();
}

//外積
double cross(P a, P b) {
  return (conj(a) * b).imag();
}

//反時計回り
int ccw(P a, P b, P c){
  if(cross(b-a,c-a) > P_eps) return 1; //COUNTER_CLOCKWISE
  if(cross(b-a,c-a) < -P_eps) return -1; //CLOCKWISE
  if(dot(b-a,c-a) < -P_eps) return -2; //ONLINE_BACK
  if(dot(a-b,c-b) < -P_eps) return 2; //ONLINE_FRONT
  return 0; //ON_SEGMENT
}

int main(){
  int x0, y0, x1, y1;
  P p0, p1;

  scanf("%d%d%d%d",&x0,&y0,&x1,&y1);
  p0 = P(x0, y0);
  p1 = P(x1, y1);

  int n;
  scanf("%d",&n);
  
  for(int i=0;i<n;i++){
    int x2, y2;
    scanf("%d%d",&x2, &y2);

    switch(ccw(p0,p1,P(x2,y2))){
    case 1:
      puts("COUNTER_CLOCKWISE");
      break;
    case -1:
      puts("CLOCKWISE");
      break;
    case 2:
      puts("ONLINE_FRONT");
      break;
    case -2:
      puts("ONLINE_BACK");
      break;
    case 0:
      puts("ON_SEGMENT");
      break;
    }
  }
  
  return 0;
}

