#include <bits/stdc++.h>
using namespace std;
int n, h, a[3000000];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) a[i] = i;
  h = 1;
  for (int i = 2; i <= n; ++i) {
    a[h + n] = a[h + (n / i * i) + 1 - 1];
    for (int j = n / i - 1; j >= 0; --j)
      a[h + i * (j + 1) + 1 - 1] = a[h + i * j + 1 - 1];
    ++h;
  }
  for (int i = 1; i < n; ++i) printf("%d ", a[h + i - 1]);
  printf("%d\n", a[h + n - 1]);
  return 0;
}
