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

~/algor $ cat problems/funksiya-ikki-sonni-tartiblash

Middle number

Easy 1000 ms 128 MB 25%
Share

Write a function Middle(a, b, c) that returns the number in the middle when the integers $a$, $b$ and $c$ are arranged in ascending order.

Example 1: Middle(9, 2, 5) → 5 — sorted: $2$, $5$, $9$.

Example 2: Middle(4, 7, 4) → 4 — sorted: $4$, $4$, $7$.

Write only the function body.

Three numbers go into the function Middle, which returns the one in the middle after sorting

Input

One line with three integers $a$, $b$ and $c$ — the arguments of the function.

Output

The value returned by the function: an integer.

Note

$-10^{9} \le a, b, c \le 10^{9}$

Examples

Input #1
9 2 5
Output #1
5
Input #2
4 7 4
Output #2
4

Sign in to submit a solution

Signing up is free and takes a minute.