SP1771 NQUEEN - Yet Another N-Queen Problem

Description

After solving [Solution to the _n_ Queens Puzzle](http://acm.pku.edu.cn/JudgeOnline/problem?id=3239) by constructing, LoadingTime wants to solve a harder version of the N-Queen Problem. Some queens have been set on particular locations on the board in this problem. Can you help him??

Input Format

The input contains multiple test cases. Every line begins with an integer N (N

Output Format

For each test case, print a line consists of N numbers separated by spaces, representing the column number of the queen in each row. If there are more than one answer, print any one of them.