atcoder#ARC129C. [ARC129C] Multiple of 7

[ARC129C] Multiple of 7

Score : 500500 points

Problem Statement

Given is an integer NN.

Find one string ss consisting of 1, 2, \cdots, 9 that satisfies the conditions below.

  • The length of ss, s|s|, is at most 10610^6.
  • There are exactly NN pairs of integers (l,r)(l,r) (1lrs1 \leq l \leq r \leq |s|) that satisfy the following condition.- When the ll-th through rr-th characters of ss are extracted and seen as a number, it is divisible by 77.
  • When the ll-th through rr-th characters of ss are extracted and seen as a number, it is divisible by 77.

Under the Constraints of this problem, we can prove that a solution always exists.

Constraints

  • 1N1061 \leq N \leq 10^6
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN

Output

Print a string ss that satisfies the conditions. If multiple solutions exist, printing any of them would be accepted.

2
142

Two pairs (l,r)=(1,2),(2,3)(l,r)=(1,2),(2,3) satisfy the conditions.

3
77

Three pairs (l,r)=(1,1),(2,2),(1,2)(l,r)=(1,1),(2,2),(1,2) satisfy the conditions.