Module: Geometry. Product of vectors


Problem

4 /5


Which ear is buzzing?

Theory Click to read/hide

Construct two consecutive vectors \( (a, b)\) and \((b,c)\). Let us determine the sign of the oriented angle between them. For a left turn, it is positive, for a right turn, it is negative. The sign can be determined using the skew product of vectors. Don't forget that the points can lie on the same line.
 

Problem

Freken Bok is at the point \(A(x_a, y_a)\) and looking straight at the Kid standing at the point \(B(x_b, y_b)\) asks the question: "Which ear is my buzzing in?". Naturally, the formidable housekeeper is buzzing in her ear, because at the point \(C(x_c, y_c)\) Carlson hovered with the engine on. Decide which Kid's answer is correct.
 
Input
The coordinates of points A, B and C are entered from the keyboard. The initial data are integers, modulo not exceeding 1000.
 
Output
Print the word LEFT (in capital letters) if the housekeeper's left ear is buzzing, RIGHT – if on the right, BOTH – if  buzzing in both left and right is the same.

 

Examples
# Input Output
1 0 0 1 0 0 1 LEFT