Problem: Big P is fairly good in mathematics.
His teacher has asked him to add two numbers.
Now , Big P has a problem that he sometimes writes a '6' as a '5' and vice versa.
Given two numbers, A and B, calculate the minimum and the maximum sum Big P could possibly get. 

Input:
The first and only line of input contains positive integers A and B . 

Output:
In single line of output, print two space separated integers, minimum and maximum sum Big P could get. 

Constraints:

1 ≤ A,B ≤ 1000000

SAMPLE INPUT
11 25

SAMPLE OUTPUT
36 37

Solution (in PYTHON):

Solution:
from sys import stdin
def max_sum(a, b):
    if '5' in a:
        a = a.replace('5', '6')
    if '5' in b:
        b = b.replace('5', '6')
    # print("max:")
    # print(a, b)
    return int(a) + int(b)

def min_sum(a, b):
    if '6' in a:
        a=a.replace('6', '5')
    if '6' in b:
        b=b.replace('6', '5')
    # print("min:")
    # print(a, b)
    return int(a) + int(b)

def main():
    lines = stdin.readline()
    lines = lines.split(' ')
    lines[1] = lines[1].replace('\n', '')
    a = lines[0]
    b = lines[1]
    print min_sum(a, b),
    print max_sum(a, b)
        
if __name__ == '__main__':
    main()