Five numbers. Minimum sum is total minus the maximum. Maximum sum is total minus the minimum.
Input
1 2 3 4 5
Output
10 14