atcoder#ARC118C. [ARC118C] Coprime Set

[ARC118C] Coprime Set

Score : 500500 points

Problem Statement

Given is a positive integer NN. Print an integer sequence A=(A1,A2,,AN)A = (A_1, A_2, \ldots, A_N) satisfying all of the following:

  • 1Ai100001\leq A_i\leq 10000;
  • AiAjA_i\neq A_j and gcd(Ai,Aj)>1\gcd(A_i, A_j) > 1 for iji\neq j;
  • gcd(A1,A2,,AN)=1\gcd(A_1, A_2, \ldots, A_N) = 1.

We can prove that, under the Constraints of this problem, such an integer sequence always exists.

Constraints

  • 3N25003\leq N\leq 2500

Input

Input is given from Standard Input in the following format:

NN

Output

Print the elements in your integer sequence AA satisfying the conditions in one line, with spaces in between.

A1A_1 A2A_2 \ldots ANA_N

If multiple sequences satisfy the conditions, any of them will be accepted.

4
84 60 105 70

All of the conditions are satisfied, since we have:

  • gcd(84,60)=12\gcd(84,60) = 12
  • gcd(84,105)=21\gcd(84,105) = 21
  • gcd(84,70)=14\gcd(84,70) = 14
  • gcd(60,105)=15\gcd(60,105) = 15
  • gcd(60,70)=10\gcd(60,70) = 10
  • gcd(105,70)=35\gcd(105,70) = 35
  • gcd(84,60,105,70)=1\gcd(84,60,105,70) = 1