#arc129c. [arc129_c]Multiple of 7
[arc129_c]Multiple of 7
Problem Statement
Given is an integer .
Find one string consisting of 1
, 2
, , 9
that satisfies the conditions below.
- The length of , , is at most .
- There are exactly pairs of integers () that satisfy the following condition.
- When the -th through -th characters of are extracted and seen as a number, it is divisible by .
Under the Constraints of this problem, we can prove that a solution always exists.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print a string that satisfies the conditions. If multiple solutions exist, printing any of them would be accepted.
Sample Input 1
2
Sample Output 1
142
Two pairs satisfy the conditions.
Sample Input 2
3
Sample Output 2
77
Three pairs satisfy the conditions.