atcoder#ARC115C. [ARC115C] ℕ Coloring

[ARC115C] ℕ Coloring

Score : 500500 points

Problem Statement

Given is an integer NN. Among the sequences of NN positive integers A1,A2,,ANA_1, A_2, \ldots, A_N satisfying the following condition, print one that minimizes the maximum value in the sequence.

  • If ii divides jj, AiAjA_i \neq A_j (1i<jN)(1 \leq i < j \leq N).

Constraints

  • 1N1051 \leq N \leq 10^5

Input

Input is given from Standard Input in the following format:

NN

Output

Print a line containing the elements of your sequence, with spaces in between.

If there are multiple valid solutions, any of them will be accepted.

A1A_1 A2A_2 \ldots ANA_N

4
1 2 2 3

This solution satisfies all of the following conditions:

  • A1A2A_1 \neq A_2
  • A1A3A_1 \neq A_3
  • A1A4A_1 \neq A_4
  • A2A4A_2 \neq A_4

Additionally, there is no sequence satisfying these conditions where the maximum value in the sequence is 22 or less, so this is a valid solution.