#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n = 0;
  int k = 0;
  cin >> n;
  vector<int> arr(2 * n + 1, 0);
  for (int i = 1; i <= n; ++i) arr[i] = i;
  for (int i = 2; i <= n; ++i) {
    int last = arr[i - 1];
    for (int j = 2 * i - 1; j < n + 2 * i - 1; j += i) {
      int index = min(j, n + i - 1);
      int tmp = arr[index];
      arr[index] = last;
      last = tmp;
    }
  }
  for (int i = n; i < 2 * n; ++i) cout << arr[i] << " ";
  cout << endl;
  return 0;
};
