#include <bits/stdc++.h>
using namespace std;
const int MX = (1 << 21);
int n, arr[MX], arr2[MX];
void modify(int st, int en, int K) {
  bool is = 0;
  int last;
  for (int j = st + K; j <= en; j += K) arr2[j] = arr[j - K], last = j;
  if (last != en) arr2[en] = arr[last];
  for (int j = st + K; j <= en; j += K) arr[j] = arr2[j];
  arr[en] = arr2[en];
}
int main() {
  cin >> n;
  for (int j = 1; j <= n; j++) arr[j] = j;
  for (int j = 1; j < n; j++) {
    modify(j, n + j, j + 1);
  }
  for (int j = n; j < n * 2; j++) cout << arr[j] << ' ';
}
