<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 <cstdlib>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(v) push_back(v)
#define uniq(v) (v).erase(unique(all(v)),(v).end())
#define bitcnt(x) __builtin_popcount(x)
#define fst first
#define snd second
#define Pqaz(T) priority_queue<T,vector<T>,greater<T>>
#define Pqza(T) priority_queue<T>
#define put(x) cout << x;
#define puts(x) cout << x << ' ';
#define putln(x) cout << x << endl;
#define ENJYU std::ios::sync_with_stdio(false);std::cin.tie(0);

const double EPS = 1e-12;
typedef complex<double> comp;

void solve(void){

	int x1, y1, x2, y2, Q;
	cin >> x1 >> y1 >> x2 >> y2 >> Q;

	comp o(x1, y1), p(x2-x1, y2-y1), r;

	//回転用
	r = polar(1.0, arg(p));

	while(Q--)
	{
		int x3, y3;
		cin >> x3 >> y3;

		comp q(x3-x1, y3-y1);

		q /= r;

		//printf("%.12lf %.12lf\n", norm(p), norm(q));

		if (abs(arg(q)) < EPS)
		{
			if (norm(p) >= norm(q) - 1e-6)
			{
				putln("ON_SEGMENT");
			}
			else
			{
				putln("ONLINE_FRONT");
			}
		}
		else if (abs(abs(arg(q))-M_PI) < EPS)
		{
			putln("ONLINE_BACK");
		}
		else if (arg(q) > 0)
		{
			putln("COUNTER_CLOCKWISE");
		}
		else
		{
			putln("CLOCKWISE");
		}
	}
}

int main(void){
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}

