let () =
  let cross (x0,y0) (x1,y1) = x0*.y1-.x1*.y0 and
      inner (x0,y0) (x1,y1) = x0*.x1+.y0*.y1 and
      norm (x,y) = x*.x+.y*.y
  in
  let (px0,py0,px1,py1) = Scanf.scanf " %f %f %f %f\n" (fun w x y z -> (w,x,y,z)) and
      n = read_int () in
  let v0 = (px1-.px0, py1-.py0) in
  let rec read = function
      0 -> ()
    | i ->
       let (px2,py2) = Scanf.scanf " %f %f\n" (fun x y -> (x,y)) in
       let v1 = (px2-.px0, py2-.py0) in
       if cross v0 v1 > (1e-10) then print_endline "COUNTER_CLOCKWISE"
       else if cross v0 v1 < -.(1e-10) then print_endline "CLOCKWISE"
       else if inner v0 v1 < -.(1e-10) then print_endline "ONLINE_BACK"
       else if norm v0 < norm v1 then print_endline "ONLINE_FRONT"
       else print_endline "ON_SEGMENT";
       read (i-1)
  in read n
;;