SS - SO SIMPLE!!!

no tags 

After he got tired of rotating tables, the professor gave RK another problem. He wrote two integers, A and B, on the blackboard and asked him to add them.

RK is never wrong with his calculation, but sometimes he doesn’t copy the numbers correctly.

The only mistake he ever makes is copying a ‘5’ as a ‘6’, and vice versa.

Given two numbers, A and B, calculate the minimum and the maximum sum RK could possibly get.

Input

First line of Input contains no. of test cases T (T <= 100). Each test case contains one line having two positive integer A and B (1 <= A, B <= 10^6).

Output

For each test case print two space separated integers, minimum and maximum sum RK could get.

Example

Input:
2
11 25
16796 58786

Output:
36 37
74580 85582

hide comments
vank: 2014-01-28 21:36:18

thnx bt didn't get the answer..

Mitch Schwartz: 2014-01-28 21:30:57

Moved to tutorial.

vank: 2014-01-28 21:12:42

please some help...
what if min and max are equal should i o/p any one of them or both...

Last edit: 2014-01-28 21:35:48

Added by:BLANKRK
Date:2014-01-28
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64