#1231
Unrated
YODA
시간 제한
1s
메모리 제한
64MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

1 second, 64 MB, 50 points A long, long time ago in a galaxy far, far away a big collision of integers is taking place right now. What happens when two integers collide? During collision, each digit of one number compares it- self to the corresponding digit of the other number (the least significant digit with the other’s least significant digit, and so on). The smaller digit “falls out” of the number containing it. Additionally, if the digits are the same, nothing happens. If a number doesn’t consist of a corresponding digit, then we consider it to be zero. After all comparisons of corresponding digits, the leftover digits in the number come closer and create a new number. For example: Write a programme that will, for two given integers, determine their values after collision. If it happens that all the digits of one number fell out, then for that number output the message “YODA”.

입력

The first line of input contains the integer N (1 ⩽N ⩽109), one of the integers from the task. The second line of input contains the integer M (1 ⩽N ⩽109), one of the integers from the task.

출력

The first line of output must contain the new value of the first given integer from the task. The second line of output must contain the new value of the second given integer from the task.

예제 입력 1

300
500

예제 출력 1

0
500

예제 입력 2

65743
9651

예제 출력 2

673
95

예제 입력 3

2341
6785

예제 출력 3

YODA
6785
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.