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

~/algor $ cat problems/yaqinroq-nuqta

The closer point

Easy 1000 ms 64 MB 24%
Share

Three points $A$, $B$ and $C$ are given on the number line. Determine which of the points $A$ and $C$ is closer to $B$, and find its distance to $B$.

On the number line: which of A and C is closer to B, and the distance

Input

One line with three integers: the coordinates of $A$, $B$ and $C$.

Output

One line: the name of the closer point (A or C) and the distance — an integer.

Note

$-10^{9} \le A, B, C \le 10^{9}$
$|A - B| \ne |C - B|$

Examples

Input #1
1 3 6
Output #1
A 2
Input #2
6 3 1
Output #2
C 2

Sign in to submit a solution

Signing up is free and takes a minute.