USACO 2020 December

Do You Know Your ABCs?

Farmer John's cows have been holding a daily online gathering on the "mooZ" video meeting platform. For fun, they have invented a simple number game to play during the meeting to keep themselves entertained.

Elsie has three positive integers a, b and c (abc). These integers are supposed to be secret, so she will not directly reveal them to her sister Bessie. Instead, she gives Bessie seven (not necessarily distinct) integers in the range 1..109, claiming that they are a, b, c, a + b, b + c, c + a and a + b + c in some order.

Given a list of these seven numbers, help Bessie determine a, b and c It can be shown that the answer is unique.


Seven integers.


Print a, b and c.

Time limit 1 second
Memory limit 128 MiB
Input example #1
2 2 11 4 9 7 9
Output example #1
2 2 7
Source 2020 USACO December, Bronze