#include <bits/stdc++.h>
using namespace std;
int n, son;
int t[2000005], *ar;
void read() {
  scanf("%d", &n);
  return;
}
void solve() {
  int i, j, p, temp;
  read();
  ar = t + 1;
  for (i = 1; i <= n; i++) ar[i] = i;
  for (i = 2; i <= n; i++, ar++)
    for (j = 1, p = ar[1]; 1; j += i) {
      if (j > n) j = n + 1;
      temp = ar[j];
      ar[j] = p;
      p = temp;
      if (j > n) break;
    }
  for (i = 1; i <= n; i++) printf("%d ", ar[i]);
  puts("");
  return;
}
int main() {
  solve();
  return 0;
}
