<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
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
input:
0 0 2 0
3
-1 0
0 0
3 0

output:
ONLINE_BACK
ON_SEGMENT
ONLINE_FRONT
"""

import sys

EPS = 1e-9


def cross(a, b):
    return a.real * b.imag - a.imag * b.real


def dot(a, b):
    return a.real * b.real + a.imag * b.imag


def calc_distance(p_info):
    for point in p_info:
        p2_real, p2_imag = map(int, point)
        p2 = p2_real + p2_imag * 1j
        a, b = p1 - p0, p2 - p0
        if cross(a, b) > EPS:
            print('COUNTER_CLOCKWISE')
        elif cross(a, b) < -1 * EPS:
            print('CLOCKWISE')
        elif dot(a, b) < -1 * EPS:
            print('ONLINE_BACK')
        elif abs(a) < abs(b):
            print('ONLINE_FRONT')
        else:
            print('ON_SEGMENT')
    return None


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    base_line = tuple(map(int, _input[0].split()))
    p0, p1 = (x + y * 1j for x, y in zip(base_line[::2], base_line[1::2]))

    q_num = int(_input[1])
    q_list = map(lambda x: x.split(), _input[2:])
    calc_distance(q_list)