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
m,n=map(int,raw_input().split())
add=m+n
a=0
temp=add
if ('5' in str(n)) or ('6' in str(n)):
	while n>0:
		b=n%10
		if b==6:
			temp-=(10**a)
		if b==5:
			add+=(10**a)
		n=n/10
		a+=1
if ('5' in str(m)) or ('6' in str(m)):
    a=0
    while m>0:
		b=m%10
		if b==6:
			temp-=(10**a)
		if b==5:
			add+=(10**a)
		m=m/10
		a+=1

print temp,add