#include <bits/stdc++.h>
namespace ztd {
using namespace std;
template <typename T>
inline T read(T& t) {
  t = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch >= '0' && ch <= '9') t = t * 10 + ch - '0', ch = getchar();
  return t;
}
const int mod = 998244353;
}  // namespace ztd
using namespace ztd;
const int maxn = 19;
int n, k, p[maxn], CNT[2];
long long A, ha, pw[maxn << 1];
unordered_map<long long, int> mp[2];
vector<long long> way[2][1 << maxn];
inline void calcp(int s, int l, int r, int win) {
  vector<int> vec[8];
  int tot = (1 << (k - 1)) - 1;
  for (int i = 1; i <= r - l + 1; ++i)
    p[i] = (1 << (k - 1)), vec[0].push_back(i);
  for (int i = 1, cnt = 0; i <= k - 1 && cnt <= tot; ++i) {
    if (vec[i - 1].size() == 1) break;
    for (int j = 0; j < vec[i - 1].size(); j += 2) {
      if (s & (1 << cnt))
        vec[i].push_back(vec[i - 1][j]), p[vec[i - 1][j]] >>= 1;
      else
        vec[i].push_back(vec[i - 1][j + 1]), p[vec[i - 1][j + 1]] >>= 1;
      ++cnt;
      if (cnt > tot) break;
    }
  }
  for (int i = 1; i <= r - l + 1; ++i) {
    if (p[i] == 1 && win) p[i] = 0;
    ++p[i];
  }
}
inline void output(int x, int y, int ywin) {
  calcp(x, 1, n, !ywin);
  for (int i = 1; i <= n; ++i) cout << p[i] << ' ';
  calcp(y, n + 1, n * 2, ywin);
  for (int i = 1; i <= n; ++i) cout << p[i] << ' ';
  cout << '\n';
  exit(0);
}
inline void work(int l, int r) {
  int tot = (1 << n) - 1;
  for (int i = 0; i <= tot; ++i) {
    for (int win = 0; win <= 1; ++win) {
      calcp(i, l, r, win);
      long long hh = 0;
      for (int j = l; j <= r; ++j) hh = (hh + pw[p[j - l + 1]] * j % mod) % mod;
      if (l == 1) {
        if (!mp[win][hh]) mp[win][hh] = ++CNT[win];
        way[win][CNT[win]].push_back(i);
      } else {
        long long rest = (ha - hh + mod) % mod;
        if (!mp[!win][rest]) continue;
        rest = mp[!win][rest];
        for (long long j : way[!win][rest]) output(j, i, win);
      }
    }
  }
}
signed main() {
  n = 1 << (read(k) - 1);
  read(A);
  read(ha);
  pw[0] = 1;
  for (int i = 1; i <= 35; ++i) pw[i] = pw[i - 1] * A % mod;
  work(1, n);
  work(n + 1, n * 2);
  puts("-1");
  return 0;
}
