#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 5;
int n, p[2 * MAXN];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) p[i] = i;
  for (int i = 1; i <= n - 1; ++i) {
    int block_size = i + 1;
    vector<int> v;
    for (int j = i; j < i + n; j += block_size) v.push_back(j);
    int last = i + n;
    for (int j = v.back(); !v.empty(); j = v.back()) {
      p[last] = p[j];
      last = j;
      v.pop_back();
    }
  }
  for (int i = n; i < 2 * n; ++i) cout << p[i] << " ";
}
