#include <bits/stdc++.h>
using namespace std;
long long ones[100];
long long pas[100][100];
int n;
void init() {
  for (int i = 0; i < int(100); i++) {
    pas[i][0] = pas[i][i] = 1ll;
    for (int j = 1; j < i; j++) pas[i][j] = pas[i - 1][j - 1] + pas[i - 1][j];
  }
  for (int k = 0; k < int(62); k++)
    for (int i = 0; i < int(k / 2 + 1); i++) ones[k] += pas[k - i][i];
}
void solve(long long k) {
  vector<bool> solution(n);
  while (true) {
    int l = 1, m, r = 60;
    while (l != r) {
      m = (l + r + 1) / 2;
      if (ones[m] <= k)
        l = m;
      else
        r = m - 1;
    }
    if (ones[l] == k) {
      if (l % 2 == 0)
        for (int i = 0; i < int(l); i++) solution[n - 1 - i] = true;
      else
        for (int i = 0; i < int(l); i++) solution[n - 1 - i] = (i != 0);
      break;
    } else {
      solution[n - l] = solution[n - l - 1] = true;
      k -= ones[l];
    }
  }
  vector<int> p(n);
  for (int i = 0; i < int(n); i++) p[i] = i + 1;
  for (int i = 0; i < int(n); i++)
    if (solution[n - 1 - i]) {
      swap(p[n - 1 - i], p[n - 1 - i - 1]);
      solution[n - 1 - i] = solution[n - 1 - i - 1] = false;
    }
  for (int i = 0; i < int(n); i++)
    printf("%d%c", p[i], i == n - 1 ? '\n' : ' ');
}
int main() {
  long long k;
  scanf("%d %lld", &n, &k);
  init();
  solve(k);
}
