#include <bits/stdc++.h>
using namespace std;
int n;
int a[2000020], *p = a;
int main() {
  cin >> n;
  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) {
      int w = p[j];
      p[j] = t;
      t = w;
    }
    p[n + 1] = t;
    p++;
  }
  for (int i = n; i < 2 * n; i++) printf("%d ", a[i]);
  return 0;
}
