#include <bits/stdc++.h>
const int N = (int)1e6;
int ary[N * 2 + 100];
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) ary[i] = i;
  for (int head = 1; head <= n - 1; head++) {
    int k = head + 1;
    int last = head + n - 1;
    int prev = 0;
    for (int j = head; j <= last; j += k) {
      int tmp = ary[j];
      ary[j] = prev;
      prev = tmp;
    }
    ary[last + 1] = prev;
  }
  std::stringstream ss;
  for (int i = 1; i <= n; i++) {
    ss << ary[n - 1 + i];
    if (i + 1 <= n) {
      ss << " ";
    } else {
      ss << "\n";
    }
  }
  cout << ss.str();
}
