#include <stdio.h>
#include <algorithm>

using namespace std;

int a[50002];
int n;

int main(void)
{
int i, j, t, k;
  freopen("heapsort.in",  "rt", stdin);
  freopen("heapsort.out", "wt", stdout);
  scanf("%d", &n);
  a[0] = 1;
  for(k = 2; k <= n; k++)
  {
    j = k-2;
    while(j)
    {
      t = (j-1) >> 1;
      swap(a[j], a[t]);
      j = t;
    }
    a[k-1] = k;
    swap(a[0], a[k-1]);
  }
  for(i = 0; i < n; i++)
  {
    if(i) putchar(' ');
    printf("%d", a[i]);
  }
  putchar('\n');
  return 0;
}