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:
import math
a,b=map(str,raw_input().split())
a1=''
a2=''
b1=''
b2=''
for ch in a:
	if ch=='6':
		a1=a1+'5'
	else:
		a1=a1+ch
	if ch=='5':
		a2=a2+'6'
	else:
		a2=a2+ch
for ch in b:
	if ch=='6':
		b1=b1+'5'
	else:
		b1=b1+ch
	if ch=='5':
		b2=b2+'6'
	else:
		b2=b2+ch
print str(int(a1)+int(b1))+" "+str(int(a2)+int(b2))