<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
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// 入力
		Scanner sc = new Scanner(System.in);
		double xp0 = sc.nextDouble();
		double yp0 = sc.nextDouble();
		Vector2d p0 = new Vector2d(xp0, yp0);
		double xp1 = sc.nextDouble();
		double yp1 = sc.nextDouble();
		Vector2d p1 = new Vector2d(xp1, yp1);
		int q = sc.nextInt();
		for (int i=0; i<q; i++) {
			double x = sc.nextDouble();
			double y = sc.nextDouble();
			System.out.println(solve(p0, p1, new Vector2d(x, y)));
		}
		sc.close();
	}

	static class Vector2d {
		Vector2d(Double x, Double y){
			this.x = x;
			this.y = y;
		}
		Double x;
		Double y;
		public String toString() {
			return String.format("%1$.10f %2$.10f", x, y);
		}
	}

	public static Vector2d sub(Vector2d v1, Vector2d v2){
		return new Vector2d(v2.x - v1.x, v2.y - v1.y);
	}

	public static String solve(Vector2d p0, Vector2d p1, Vector2d p2) {
		Vector2d v1 = sub(p0, p1);
		Vector2d v2 = sub(p0, p2);
		Double a = v1.x * v2.y - v1.y * v2.x;
		if(a == 0) {
			if(v2.x / v1.x < 0 || v2.y / v1.y < 0) {
				return "ONLINE_BACK";
			} else if(v2.x / v1.x > 1 || v2.y / v1.y > 1) {
				return "ONLINE_FRONT";
			} else {
				return "ON_SEGMENT";
			}
		} else if(a > 0) {
			return "COUNTER_CLOCKWISE";
		} else {
			return "CLOCKWISE";
		}
	}
}

