#include <bits/stdc++.h>
using namespace std;
static const int INF = 500000000;
template <class T>
void debug(T a, T b) {
  for (; a != b; ++a) cerr << *a << ' ';
  cerr << endl;
}
int n;
int ar[2000005];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) ar[i] = i;
  int b = 0;
  for (int i = 2; i <= n; ++i) {
    for (int j = (n - 1) / i * i; j >= 0; j -= i) {
      ar[min(j + i, n) + b] = ar[j + b];
    }
    ++b;
  }
  for (int i = 0; i < n; ++i) printf("%d\n", ar[i + b] + 1);
  return 0;
}
