시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 4151 2952 2686 72.752%

문제

상근이는 2863번에서 표를 너무 열심히 돌린 나머지 5와 6을 헷갈리기 시작했다.

상근이가 숫자 5를 볼 때, 5로 볼 때도 있지만, 6으로 잘못 볼 수도 있고, 6을 볼 때는, 6으로 볼 때도 있지만, 5로 잘못 볼 수도 있다.

두 수 A와 B가 주어졌을 때, 상근이는 이 두 수를 더하려고 한다. 이때, 상근이가 구할 수 있는 두 수의 가능한 합 중, 최솟값과 최댓값을 구해 출력하는 프로그램을 작성하시오.

입력

첫째 줄에 두 정수 A와 B가 주어진다. (1 <= A,B <= 1,000,000)

출력

첫째 줄에 상근이가 구할 수 있는 두 수의 합 중 최솟값과 최댓값을 출력한다.

예제 입력 1

1430 4862

예제 출력 1

6282 6292
W3sicHJvYmxlbV9pZCI6IjI4NjQiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiI1XHVjNjQwIDZcdWM3NTggXHVjYzI4XHVjNzc0IiwiZGVzY3JpcHRpb24iOiI8cD5cdWMwYzFcdWFkZmNcdWM3NzRcdWIyOTQgMjg2M1x1YmM4OFx1YzVkMFx1YzExYyBcdWQ0NWNcdWI5N2MgXHViMTA4XHViYjM0IFx1YzVmNFx1YzJlY1x1ZDc4OCBcdWIzY2NcdWI5YjAgXHViMDk4XHViYTM4XHVjOWMwIDVcdWM2NDAgNlx1Yzc0NCBcdWQ1ZjdcdWFjMDhcdWI5YWNcdWFlMzAgXHVjMmRjXHVjNzkxXHVkNTg4XHViMmU0LjxcL3A+XHJcblxyXG48cD5cdWMwYzFcdWFkZmNcdWM3NzRcdWFjMDAgXHVjMjJiXHVjNzkwIDVcdWI5N2MgXHViY2ZjIFx1YjU0YywgNVx1Yjg1YyBcdWJjZmMgXHViNTRjXHViM2M0IFx1Yzc4OFx1YzljMFx1YjljYywgNlx1YzczY1x1Yjg1YyBcdWM3OThcdWJhYmIgXHViY2ZjIFx1YzIxOFx1YjN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