eolymp
Competitions

26-ЖДУ_2

Annealing peaceful queens!

prb2764ArrangeNqueenson a squareN×Nboard, so thatno twohiteach other -a verydifficult task.That's whyitinstructedyou.

Input

Ina singleinput lineisthe number4N200 - sizeboard.

Output

Outputof N numbersa: ai - is the number ofhorizontal,on whichyou put thequeenoccupying thei-thujavertical.Numbering ofcontourscomesfrom the bottom up, from1 to N (as inconventionalchess board).

Time limit 2 seconds
Memory limit 64 MiB
Input example #1
5
Output example #1
4 2 5 3 1