Codeforces Round 835 (Div. 4) |
---|

Finished |

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

implementation

sortings

*800

No tag edit access

The problem statement has recently been changed. View the changes.

×
A. Medium Number

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputGiven three distinct integers $$$a$$$, $$$b$$$, and $$$c$$$, find the medium number between all of them.

The medium number is the number that is neither the minimum nor the maximum of the given three numbers.

For example, the median of $$$5,2,6$$$ is $$$5$$$, since the minimum is $$$2$$$ and the maximum is $$$6$$$.

Input

The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 6840$$$) — the number of test cases.

The description of each test case consists of three distinct integers $$$a$$$, $$$b$$$, $$$c$$$ ($$$1 \leq a, b, c \leq 20$$$).

Output

For each test case, output a single integer — the medium number of the three numbers.

Example

Input

95 2 614 3 420 2 11 2 311 19 1210 8 206 20 34 1 319 8 4

Output

5 4 2 2 12 10 6 3 8

Codeforces (c) Copyright 2010-2024 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Aug/03/2024 22:02:08 (g1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|