PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GD0000166. Hoán vị đặc biệt (Special Permutation)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Hoán vị đặc biệt (Special Permutation)

Special Permutation

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given an integer n>1n>1, construct any permutation pp of 1,2,…,n1,2,\ldots,n such that pi≠ip_i\ne i for every position ii.

Input

One line contains the integer nn.

Output

Print a permutation of 1,2,…,n1,2,\ldots,n with no fixed point.

Subtasks

  • Subtask 1 (20 points): 2≤n≤82\le n\le 8.
  • Subtask 2 (30 points): 2≤n≤402\le n\le 40.
  • Subtask 3 (50 points): 2≤n≤1002\le n\le 100.

Examples

Input

5

Output

2 3 4 5 1

Explanation

The permutation [2,3,4,5,1][2,3,4,5,1] uses each value 11 through 55 once and differs from its index at all five positions.