#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> v(n + 1);
  for (int i = 0; i < n; ++i) v[i + 1] = i + 1;
  for (int i = 2; i <= n; ++i) {
    for (int j = i; j <= n; j += i)
      if (v[j] % i == 0) swap(v[j], v[j - 1]);
  }
  for (int i = 1; i <= n; ++i) cout << v[i] << ' ';
  return 0;
}
