All problems

Problem 764

Middle of Three Numbers

Easy · 10 pts · Math, Basics, Sorting

Problem

Read three integers and print the middle one: the value that is neither the smallest nor the largest when the three are put in order. If some values are equal, the middle value of the sorted order is still well defined (for 5 5 1 it is 5). You can sort the three numbers and take the second, or compare them pairwise with a few if statements.

Input

A single line with three integers A, B and C.

Output

Print the middle value.

Constraints

-10^9 <= A, B, C <= 10^9

Example input

8 3 5

Example output

5

Explanation

Sorting 8, 3 and 5 gives 3 5 8, and the value in the middle is 5.

Every problem here can be used in a RelayTrixCode team match. Create a room.

Previous: Largest of Three Numbers Next: Leap Year Check