#include <bits/stdc++.h>
int a[2000000], n, *s = a, i, u, k;
int ck(int x) { return x < n ? x : n; }
int main() {
  scanf("%u", &n);
  for (i = 0; i < n; ++i) a[i] = 1 + i;
  for (k = 2; k <= n; ++k, ++s)
    for (u = (n - 1) / k * k; u >= 0; u -= k) s[ck(u + k)] = s[u];
  for (i = 0; i < n; ++i) printf("%u ", s[i]);
}
