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