<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
def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()
def LIR(n): return [LI() for i in range(n)]
def MI(): return map(int, input().split())

#1
#1_A
"""
x,y,s,t = map(float, input().split())
a = int(input())
s-=x
t-=y
while a:
    a -= 1
    p,q = map(float, input().split())
    p-=x
    q-=y
    ans_x = s*(q*t+p*s)/(t*t+s*s)
    ans_y = t*(q*t+p*s)/(t*t+s*s)
    print(x+ans_x, y+ans_y)
"""

#1_B
"""
p1x,p1y,c,d = MI()
q = II()
if p1x == c:
    f = 0
elif p1y == d:
    f = 1
else:
    f = 2
    m = (d-p1y)/(c-p1x)
for _ in range(q):
    px,py = MI()
    if not f:
        a = 2*p1x-px
        b = py
    elif f == 1:
        a = px
        b = 2*p1y-py
    else:
        a = (2*py+(1/m-m)*px+2*m*p1x-2*p1y)/(m+1/m)
        b = -1/m*(a-px)+py
    print(a,b)
"""

#1_C
def inner_product(a,b):
    return a[0]*b[0]+a[1]*b[1]

def cross_product(a,b):
    return a[0]*b[1]-a[1]*b[0]
p,q,c,d = MI()
a = [c-p,d-q]
r = II()
for _ in range(r):
    c,d = MI()
    b = [c-p,d-q]
    co = inner_product(a,b)
    si = cross_product(a,b)
    if si == 0:
        if co >= 0:
            if a[0]**2+a[1]**2 >= b[0]**2+b[1]**2:
                print("ON_SEGMENT")
            else:
                print("ONLINE_FRONT")
        else:
            print("ONLINE_BACK")
    elif si > 0:
        print("COUNTER_CLOCKWISE")
    else:
        print("CLOCKWISE")

