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

문제

1 second, 32 MB, 120 points An integer is considered handsome if every two of its consecutive digits are of different parity. For a given integer N, what is its closest handsome number? Please note: Numbers consisting of only one digit are handsome numbers. The distance of two numbers is the absolute value of their difference.

입력

The first and only line of input contains the positive integer N that consists of at most thousand digits and is not handsome.

출력

The first and only line of output must contain the required closest handsome number. If two closest numbers exist, output the smaller number first and then the larger one and separate them by a single space.

예제 입력 1

13

예제 출력 1

12 14

예제 입력 2

5801001

예제 출력 2

5810101
코드 제출

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

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