<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 LD = long double;

struct vec2 {
	LD x, y;
	vec2(LD x = 0, LD y = 0) : 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);
	}
	LD operator * (const vec2 &rhs) const {
		return x * rhs.x + y * rhs.y;
	}
	LD operator ^ (const vec2 &rhs) const {
		return x * rhs.y - y * rhs.x;
	}
	vec2 operator * (const LD rhs) const {
		return vec2(x * rhs, y * rhs);
	}
	friend vec2 operator * (const LD lhs, const vec2 rhs) {
		return vec2(lhs * rhs.x, lhs * rhs.y);
	}
	vec2 operator / (const LD rhs) const {
		return vec2(x / rhs, y / rhs);
	}
	LD norm2() const {
		return x * x + y * y;
	}
	LD norm() const {
		return std::sqrt(norm2());
	}
	friend std::istream& operator >> (std::istream &cin, vec2 &v) {
		return cin >> v.x >> v.y;
	}
	friend std::ostream& operator << (std::ostream &cout, const vec2 v) {
		return cout << std::fixed << std::setprecision(10) << v.x << ' ' << std::fixed << std::setprecision(10) << v.y;
	}
};
int main() {
	std::ios::sync_with_stdio(0), std::cin.tie(0);
	vec2 p0, p1, p2; int q;
	std::cin >> p0 >> p1, p1 = p1 - p0;
	std::cin >> q;
	for (int i = 1; i <= q; ++i) {
		std::cin >> p2, p2 = p2 - p0;
		if ((p1 ^ p2) > 0)
			std::cout << "COUNTER_CLOCKWISE\n";
		else if ((p1 ^ p2) < 0)
			std::cout << "CLOCKWISE\n";
		else if (p1 * p2 < 0)
			std::cout << "ONLINE_BACK\n";
		else if (p2.norm2() > p1.norm2())
			std::cout << "ONLINE_FRONT\n";
		else
			std::cout << "ON_SEGMENT\n";
	}
}

