#include <bits/stdc++.h>
using namespace std;
long long modexp(long long base, long long exp) {
  if (exp == 1)
    return base;
  else if (exp == 0)
    return 1;
  else {
    if (exp % 2 == 0) {
      long long base1 = pow(modexp(base, exp / 2), 2);
      if (base1 >= 1000000007)
        return base1 % 1000000007;
      else
        return base1;
    } else {
      long long ans = (base * pow(modexp(base, (exp - 1) / 2), 2));
      if (ans >= 1000000007)
        return ans % 1000000007;
      else
        return ans;
    }
  }
}
long long gcd(long long a, long long b) {
  if (!a) return b;
  return gcd(b % a, a);
}
long long a[2000005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (long long i = 1; i < n + 1; ++i) {
    a[i] = i;
  }
  for (long long i = 2; i < n + 1; ++i) {
    int x = n % i;
    a[n + i - 1] = a[n + i - 1 - x];
    for (int j = n + i - 1 - x; j > i - 1; j -= i) {
      a[j] = a[j - i];
    }
  }
  for (long long i = n; i < 2 * n; ++i) cout << a[i] << " ";
  return 0;
}
