#include <bits/stdc++.h>
using namespace std;
int a[2000200], *p = a;
int n;
int main() {
  while (cin >> n) {
    memset(a, 0, sizeof(a));
    p = a;
    for (int i = 1; i <= n; i++) a[i] = i;
    for (int i = 2; i <= n; i++) {
      int t = 0;
      for (int j = 1; j <= n; j += i) {
        swap(t, p[j]);
      }
      p[n + 1] = t;
      p++;
    }
    for (int i = n; i < 2 * n; i++) cout << a[i] << " ";
    cout << endl;
  }
  return 0;
}
