#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
long long pw[35];
int H;
int rnk[10] = {1, 2, 3, 5, 9, 17};
int winner[35], weight[35];
unordered_map<long long, vector<int>> record;
bool solve(int left, int right, bool win, bool comb) {
  int n = right - left + 1;
  weight[1] = 2;
  for (int i = 2; i < n; i++) weight[i] = weight[i / 2] + 1;
  for (int i = 1; i < n; i++) weight[i] = rnk[weight[i]];
  if (!comb) record.clear();
  int lim = 1 << (n - 1);
  for (int s = 0; s < lim; s++) {
    vector<int> result(n);
    long long value = 0;
    int index = left;
    for (int i = n; i < n + n; i++) winner[i] = index++;
    for (int i = n - 1; i >= 1; i--) {
      int pos = i * 2 + ((s >> (i - 1)) & 1);
      value = (value + 1LL * pw[weight[i]] * winner[pos]) % MOD;
      result[winner[pos] - left] = weight[i];
      winner[i] = winner[pos ^ 1];
    }
    if (win) {
      value = (value + 1LL * winner[1] * pw[1]) % MOD;
      result[winner[1] - left] = 1;
    } else {
      value = (value + 1LL * winner[1] * pw[2]) % MOD;
      result[winner[1] - left] = 2;
    }
    if (!comb)
      record[value] = result;
    else {
      int nv = (H - value % MOD + MOD) % MOD;
      if (record.count(nv) > 0) {
        vector<int> ans = record[nv];
        for (int v : result) ans.push_back(v);
        for (int v : ans) printf("%d ", v);
        printf("\n");
        return true;
      }
    }
  }
  return false;
}
int main() {
  int K, A;
  scanf("%d%d%d", &K, &A, &H);
  int n = 1 << K;
  pw[0] = 1;
  for (int i = 1; i <= n; i++) pw[i] = pw[i - 1] * A % MOD;
  solve(1, n / 2, false, false);
  if (solve(n / 2 + 1, n, true, true)) return 0;
  solve(1, n / 2, true, false);
  if (solve(n / 2 + 1, n, false, true)) return 0;
  printf("-1\n");
  return 0;
}
