The Length of the Sequence

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Consider the segment of non-negative integers from ll to rr. Write them in a row in decimal notation, getting a string aa. For example, if l=3l=3 and r=10r=10, a=345678910a=345678910.

You have to find such segment of consecutive non-negative integers \[l,r]\[l,r] (0lr10180 \le l \le r \le 10^{18}) that the length of the string aa, corresponding to this segment, is exactly SS, and the number of integers in the segment \[l,r]\[l,r] is maximum possible.

입력

The only line contains one integer SS (1S10181 \le S \le 10^{18}).

출력

Print the length of the optimal segment \[l,r]\[l,r] in the first line. If there is no solution, print 1-1.

If the solution exists, print two integers ll and rr in the second line.

If there are multiple optimal solutions, print any of them.