#include <bits/stdc++.h>
using namespace std;
int n, i, j, f[2220000];
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) f[i] = i;
  for (i = 2; i <= n; i++) {
    int g = 0;
    for (j = i - 1; j < n + i - 1; j += i) swap(g, f[j]);
    f[i + n - 1] = g;
  }
  for (i = n; i < n * 2; i++) printf("%d ", f[i]);
  return 0;
}
