<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>
#include <vector>
#include <algorithm>

using namespace std;

template<class T>
struct Vec2
{
	Vec2(){}
	Vec2(T _x, T _y) : x(_x), y(_y) {}

	Vec2 operator+(const Vec2& rhs) const { return Vec2(x + rhs.x, y + rhs.y); }
	Vec2 operator-(const Vec2& rhs) const { return Vec2(x - rhs.x, y - rhs.y); }
	Vec2 operator*(T s) const { return Vec2(x*s, y*s); }
	Vec2 operator/(T s) const { return Vec2(x/s, y/s); }
	T dot(const Vec2& rhs) const { return x*rhs.x + y*rhs.y; }
	T cross(const Vec2& rhs) const { return x*rhs.y - y*rhs.x; }
	T sqlength() const { return x*x + y*y; }
	double length() const { return sqrt(sqlength()); }
	bool operator<(const Vec2& rhs) const
	{
		if (x != rhs.x) return x < rhs.x;
		return y < rhs.y;
	}

	T x;
	T y;
};

template<class T>
T cross(const Vec2<T> &O, const Vec2<T> &A, const Vec2<T> &B)
{
	return (A - O).cross(B - O);
}

template<class T>
bool IsIntSegments(const Vec2<T>& A1, const Vec2<T>& A2, const Vec2<T>& B1, const Vec2<T>& B2)
{
	return (cross(A1, A2, B1)*cross(A1, A2, B2) < 0 && cross(B1, B2, A1)*cross(B1, B2, A2) < 0);
}

template<class T>
bool IsPointOnSegment(const Vec2<T>& P, const Vec2<T>& S, const Vec2<T>& E)
{
	Vec2<T> dir = E - S;
	if ((P - S).cross(dir) != 0) {
		return false;
	}
	T prd = (P - S).dot(dir);
	if (prd < 0) {
		return false;
	}
	return prd <= dir.dot(dir);
}

int main()
{
	typedef Vec2<long long> Vec;
	Vec P[3];
	cin >> P[0].x >> P[0].y;
	cin >> P[1].x >> P[1].y;

	int q;
	cin >> q;
	for (int i = 0; i < q; i++) {
		cin >> P[2].x >> P[2].y;

		Vec d1 = P[1] - P[0];
		Vec d2 = P[2] - P[0];
		if (d1.cross(d2) > 0) {
			puts("COUNTER_CLOCKWISE");
		}
		else if (d1.cross(d2) < 0) {
			puts("CLOCKWISE");
		}
		else if (d1.dot(d2) < 0) {
			puts("ONLINE_BACK");
		}
		else if (d1.dot(d1) < d2.dot(d2)) {
			puts("ONLINE_FRONT");
		}
		else {
			puts("ON_SEGMENT");
		}
	}
	return 0;
}
