#include <bits/stdc++.h>
using namespace std;
int n;
int a[2000009];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) a[i] = i;
  for (int i = 2; i <= n; i++) {
    int x = a[i - 1];
    for (int j = i - 1 + i; j < i + n - 1; j += i) {
      int y = x;
      x = a[j];
      a[j] = y;
    }
    a[i + n - 1] = x;
  }
  for (int i = n; i < n * 2; i++) cout << a[i] << ' ';
  return 0;
}
