Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/vektorlar-yonalishi

Turn of three points

Easy 1000 ms 128 MB 20%
Share

Three points $A(x_{1}; y_{1})$, $B(x_{2}; y_{2})$ and $C(x_{3}; y_{3})$ are given on the plane. Determine the direction of the turn when going from $A$ through $B$ to $C$: if the turn $A \to B \to C$ is counterclockwise (to the left), print CHAP; if it is clockwise (to the right), print ONG; if all three points lie on one line, print BIR_CHIZIQDA.

Three points on the coordinate plane and the direction of the turn when passing through them

Input

One line with six integers: $x_{1}$, $y_{1}$, $x_{2}$, $y_{2}$, $x_{3}$ and $y_{3}$.

Output

One line with the corresponding word: CHAP, ONG or BIR_CHIZIQDA.

Note

$-10^{9} \le x_{i}, y_{i} \le 10^{9}$
Points $A$ and $B$ do not coincide.

Examples

Input #1
0 0 4 1 2 3
Output #1
CHAP
Input #2
0 0 3 3 5 2
Output #2
ONG

Sign in to submit a solution

Signing up is free and takes a minute.