#include <iostream>
using namespace std;
void sort(char *a, int len)
{
int temp;
for(int i = 0; i != len; )
{
temp = a[a[i] - 1];
a[a[i] - 1] = a[i];
a[i] = temp;
if(a[i] == i + 1)
i++;
}
}
int main()
{
int a[] = {1.......n};
len = sizeof(a)/sizeof(int);
sort(a, len);
for(int i = 0; i != len; i++)
cout << a[i] << endl;
return 0;
}