#include <bits/stdc++.h>
using namespace std;
const long long N = 100005;
char en = '\n';
long long inf = 1e16;
long long mod = 1e9 + 7;
long long power(long long x, long long n, long long mod) {
  long long res = 1;
  x %= mod;
  while (n) {
    if (n & 1) res = (res * x) % mod;
    x = (x * x) % mod;
    n >>= 1;
  }
  return res;
}
void shift(long long *arr, long long k) {
  long long val = arr[0];
  for (long long i = 0; i < k - 1; i++) arr[i] = arr[i + 1];
  arr[k - 1] = val;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long arr[2 * n];
  long long st = 1;
  for (long long i = 1; i <= n; i++) arr[i] = i;
  for (long long i = 2; i <= n; i++) {
    long long temp = arr[st];
    for (long long j = st + i; j < st + n; j += i) {
      swap(arr[j], temp);
    }
    arr[st + n] = temp;
    st++;
  }
  for (long long i = st; i < st + n; i++) cout << arr[i] << " ";
  cout << en;
  return 0;
}
