#include <bits/stdc++.h>
using namespace std;
int seq[2000010];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) seq[i] = i;
  for (int i = 2; i <= n; i++) {
    int x = 0;
    for (int j = i - 1; j < n + i - 1; j += i) swap(seq[j], x);
    seq[n + i - 1] = x;
  }
  for (int i = n; i < n * 2; i++) printf("%d ", seq[i]);
  return 0;
}
