#!/bin/python3

import math
import os
import random
import re
import sys

# Complete the miniMaxSum function below.
def miniMaxSum(arr):
    d=0
    for i in range(len(arr)):
        d=d+arr[i]
    print((d-max(arr)),(d-min(arr)))

if __name__ == '__main__':
    arr = list(map(int, input().rstrip().split()))

    miniMaxSum(arr)
