#C1885. Shuffled Playlist

    ID: 45139 Type: Default 1000ms 256MiB

Shuffled Playlist

Shuffled Playlist

You are given an integer \(N\) representing the number of songs in a playlist. The original playlist is \( [1, 2, \dots, N] \). Your task is to generate a shuffled playlist that meets the following conditions:

  • The first song in the shuffled playlist must be the same as the last song of the original playlist (i.e. \(N\)).
  • No song appears in its original position. That is, for any song originally at position \(i\), it must not appear at position \(i\) in the shuffled playlist.

If such a shuffle exists, output the shuffled playlist as space-separated integers; otherwise, output Impossible (without quotes).

Note: When \(N = 1\), it is impossible to create a valid shuffle.

inputFormat

The input consists of a single integer (N) ((1 \le N \le 10^5)), representing the number of songs in the playlist. The input is read from standard input.

outputFormat

If a valid shuffle exists, output the shuffled playlist as a sequence of space-separated integers on one line. Otherwise, print Impossible on a single line. The output is written to the standard output.## sample

1
Impossible