
# Contributed by <NAME>
# https://github.com/parajshah

#!/bin/python3

import math
import os
import random
import re
import sys

# Complete the miniMaxSum function below.
def miniMaxSum(arr):
    minsum = sum(arr) - max(arr)
    maxsum = sum(arr) - min(arr)
    print(minsum,maxsum)
    return
    
if __name__ == '__main__':
    arr = list(map(int, input().rstrip().split()))

    miniMaxSum(arr)
