#include <bits/stdc++.h>
using namespace std;
int n, s[2000007];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) s[i] = i;
  for (int i = 2; i <= n; i++) {
    for (int j = i - 1; j < n + i - 1; j += i) {
      swap(s[i - 1], s[j]);
    }
    s[n + i - 1] = s[i - 1];
  }
  for (int i = n; i <= n + n - 1; i++)
    printf("%d%c", s[i], i == n + n - 1 ? '\n' : ' ');
  return 0;
}
