#K74092. Reorder Tasks

    ID: 34120 Type: Default 1000ms 256MiB

Reorder Tasks

Reorder Tasks

You are given a list of tasks with corresponding difficulty levels. Your goal is to reorder the tasks such that the difficulty levels are sorted in non-decreasing order. However, if the number of tasks ( n ) is less than 2, output the string (\text{impossible}) (since there is nothing to reorder).

inputFormat

The first line contains a single integer ( n ), representing the number of tasks. The second line contains ( n ) space-separated integers, where each integer indicates the difficulty level of a task.

outputFormat

If ( n < 2 ), output the string "impossible". Otherwise, output the sorted list of difficulty levels in non-decreasing order as space-separated integers.## sample

5
3 1 4 5 2
1 2 3 4 5