#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long mx = 1e6;
const long long inf = 2e9 + 1;
const int sz = 13;
void input() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  vector<int> a(2 * n + 1);
  for (int i = 0; i < n; ++i) a[i] = i;
  int x = n;
  for (int k = 2; k <= n; ++k) {
    int y = a[k - 2];
    for (int i = k - 2; i < x; i += k) {
      int z = (i + k < x ? a[i + k] : 0);
      a[min(x, i + k)] = y;
      y = z;
    }
    ++x;
  }
  for (int i = n - 1; i < 2 * n - 1; ++i) {
    cout << a[i] + 1 << " ";
  }
  cout << "\n";
}
int main() {
  input();
  return 0;
}
