2^k teams participate in a playoff tournament. The tournament consists of 2^k - 1 games. They are held as follows: first of all, the teams are split into pairs: team 1 plays against team 2, team 3 plays against team 4 (exactly in this order), and so on (so, 2^{k-1} games are played in that phase). When a team loses a game, it is eliminated, and each game results in elimination of one team (there are no ties). After that, only 2^{k-1} teams remain. If only one team remains, it is declared the champion; otherwise, 2^{k-2} games are played: in the first one of them, the winner of the game "1 vs 2" plays against the winner of the game "3 vs 4", then the winner of the game "5 vs 6" plays against the winner of the game "7 vs 8", and so on. This process repeats until only one team remains.

After the tournament ends, the teams are assigned places according to the tournament phase when they were eliminated. In particular:

  * the winner of the tournament gets place 1; 
  * the team eliminated in the finals gets place 2; 
  * both teams eliminated in the semifinals get place 3; 
  * all teams eliminated in the quarterfinals get place 5; 
  * all teams eliminated in the 1/8 finals get place 9, and so on. 



For example, this picture describes one of the possible ways the tournament can go with k = 3, and the resulting places of the teams:

<image>

After a tournament which was conducted by the aforementioned rules ended, its results were encoded in the following way. Let p_i be the place of the i-th team in the tournament. The hash value of the tournament h is calculated as h = (∑ _{i=1}^{2^k} i ⋅ A^{p_i}) mod 998244353, where A is some given integer.

Unfortunately, due to a system crash, almost all tournament-related data was lost. The only pieces of data that remain are the values of k, A and h. You are asked to restore the resulting placing of the teams in the tournament, if it is possible at all.

Input

The only line contains three integers k, A and h (1 ≤ k ≤ 5; 100 ≤ A ≤ 10^8; 0 ≤ h ≤ 998244352).

Output

If it is impossible to find any placing of the teams that is consistent with the data you have, print one integer -1.

Otherwise, print 2^k integers, where i-th integer should be equal to p_i (the place of the i-th team). Note that your answer should be consistent with one of the possible ways the tournament could go, and note that the initial structure of the tournament is fixed (for example, teams 1 and 2 always play in the first phase of the tournament against each other). If there are multiple ways to restore the places of the teams which are consistent with the data you have, print any of them.

Examples

Input


3 1337 75275197


Output


5 3 5 2 1 5 5 3 


Input


2 100 5040100


Output


1 3 3 2 


Input


2 100 7020100


Output


-1

Note

The tournament for the first example is described in the statement.

For the third example, the placing [1, 2, 3, 3] (team 1 gets place 1, team 2 gets place 2, teams 3 and 4 get place 3) could result in a hash value of 7020100 with A = 100, but no tournament can result in such placing since teams 1 and 2 play against each other in the semifinals, so they cannot get two first places.
from collections import defaultdict
import sys
input = sys.stdin.readline

def f(u, v, s0):
    t0 = []
    if v == 2:
        for x1 in range(1, pk // 2 + 1):
            if not x1 in s0:
                continue
            for x2 in range(pk // 2 + 1, pk + 1):
                if not x2 in s0:
                    continue
                if x1 + x2 == u:
                    t0.append((x1, x2))
                    break
    elif v == 4:
        pk1, pk2, pk3 = pk // 4, pk // 4 * 2, pk // 4 * 3
        for x1 in range(1, pk1 + 1):
            if not x1 in s0:
                continue
            for x2 in range(pk1 + 1, pk2 + 1):
                if not x2 in s0:
                    continue
                for x3 in range(pk2 + 1, pk3 + 1):
                    if not x3 in s0:
                        continue
                    for x4 in range(pk3 + 1, pk + 1):
                        if not x4 in s0:
                            continue
                        if x1 + x2 + x3 + x4 == u:
                            t0.append((x1, x2, x3, x4))
                            break
    else:
        pk1, pk2, pk3 = pk // 8, pk // 8 * 2, pk // 8 * 3
        pk4, pk5 = pk // 8 * 4, pk // 8 * 5
        pk6, pk7 = pk // 8 * 6, pk // 8 * 7
        for x1 in range(1, pk1 + 1):
            if not x1 in s0:
                continue
            for x2 in range(pk1 + 1, pk2 + 1):
                if not x2 in s0:
                    continue
                for x3 in range(pk2 + 1, pk3 + 1):
                    if not x3 in s0:
                        continue
                    for x4 in range(pk3 + 1, pk4 + 1):
                        if not x4 in s0:
                            continue
                        for x5 in range(pk4 + 1, pk5 + 1):
                            if not x5 in s0:
                                continue
                            for x6 in range(pk5 + 1, pk6 + 1):
                                if not x6 in s0:
                                    continue
                                for x7 in range(pk6 + 1, pk7 + 1):
                                    if not x7 in s0:
                                        continue
                                    for x8 in range(pk7 + 1, pk + 1):
                                        if not x8 in s0:
                                            continue
                                        if x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 == u:
                                            t0.append((x1, x2, x3, x4, x5, x6, x7, x8))
                                            break
    return t0

def solve(s):
    ans = [0] * pk
    s0 = set(w)
    for i in range(2):
        if ans[s[i] - 1]:
            return
        s0.remove(s[i])
        ans[s[i] - 1] = x[i]
    t = []
    for i in range(2, k):
        t.append(f(s[i], y[i], s0))
    if len(t) == 0:
        s1 = set()
        for i in range(pk):
            if not ans[i]:
                s1.add(i // 2)
        if len(s1) == pk // 2:
            for i in range(pk):
                if not ans[i]:
                    ans[i] = x[-1]
            print(*ans)
            exit()
    elif len(t) == 1:
        t0 = t[0]
        for t00 in t0:
            ok = 1
            s00 = []
            for i in t00:
                if not i in s0:
                    ok = 0
                    break
                s00.append(i)
                ans[i - 1] = 3
                s0.remove(i)
            if not ok:
                for i in s00:
                    ans[i - 1] = 0
                    s0.add(i)
            else:
                s1 = set()
                for i in range(pk):
                    if not ans[i]:
                        s1.add(i // 2)
                if len(s1) == pk // 2:
                    for i in range(pk):
                        if not ans[i]:
                            ans[i] = 5
                    print(*ans)
                    exit()
    elif len(t) == 2:
        t0, t1 = t[0], t[1]
        for t00 in t0:
            ok = 1
            s00 = []
            for i in t00:
                if not i in s0:
                    ok = 0
                    break
                s00.append(i)
                ans[i - 1] = 3
                s0.remove(i)
            if not ok:
                for i in s00:
                    ans[i - 1] = 0
                    s0.add(i)
            else:
                for t11 in t1:
                    ok = 1
                    s11 = []
                    for i in t11:
                        if not i in s0:
                            ok = 0
                            break
                        s11.append(i)
                        ans[i - 1] = 5
                        s0.remove(i)
                    if ok:
                        s1 = set()
                        for i in range(pk):
                            if not ans[i]:
                                s1.add(i // 2)
                        if len(s1) == pk // 2:
                            for i in range(pk):
                                if not ans[i]:
                                    ans[i] = 9
                            print(*ans)
                            exit()
                    for i in s11:
                        ans[i - 1] = 0
                        s0.add(i)
    else:
        t0, t1, t2 = t[0], t[1], t[2]
        for t00 in t0:
            ok = 1
            s00 = []
            for i in t00:
                if not i in s0:
                    ok = 0
                    break
                s00.append(i)
                ans[i - 1] = 3
                s0.remove(i)
            if not ok:
                for i in s00:
                    ans[i - 1] = 0
                    s0.add(i)
            else:
                for t11 in t1:
                    ok = 1
                    s11 = []
                    for i in t11:
                        if not i in s0:
                            ok = 0
                            break
                        s11.append(i)
                        ans[i - 1] = 5
                        s0.remove(i)
                    if not ok:
                        for i in s11:
                            ans[i - 1] = 0
                            s0.add(i)
                    else:
                        for t22 in t2:
                            ok = 1
                            s22 = []
                            for i in t22:
                                if not i in s0:
                                    ok = 0
                                    break
                                s22.append(i)
                                ans[i - 1] = 9
                                s0.remove(i)
                            if ok:
                                s1 = set()
                                for i in range(pk):
                                    if not ans[i]:
                                        s1.add(i // 2)
                                if len(s1) == pk // 2:
                                    for i in range(pk):
                                        if not ans[i]:
                                            ans[i] = 17
                                    print(*ans)
                                    exit()
                            for i in s22:
                                ans[i - 1] = 0
                                s0.add(i)
    return

k, a, h = map(int, input().split())
mod = 998244353
x = [1, 2, 3, 5, 9, 17][:(k + 1)]
y = [1, 1, 2, 4, 8, 16][:(k + 1)]
z = [pow(a, i, mod) for i in x]
if k == 1:
    ans = [-1]
    if (z[0] * 1 + z[1] * 2) % mod == h:
        ans = [1, 2]
    elif (z[0] * 2 + z[1] * 1) % mod == h:
        ans = [2, 1]
    print(*ans)
    exit()
pow2 = [1]
for _ in range(100):
    pow2.append(2 * pow2[-1] % mod)
pk = pow2[k]
w = [i for i in range(1, pk + 1)]
b = []
for i in range(k + 1):
    l, r = 0, 0
    for j in range(y[i]):
        l += w[j]
        r += w[-(j + 1)]
    b.append([j for j in range(l, r + 1)])
n1 = (k + 1) // 2
n2 = k + 1 - n1
d = defaultdict(lambda : [])
if n1 == 1:
    b0 = b[0]
    z0 = z[0]
    for i in b0:
        h0 = z0 * i % mod
        d[h0].append(tuple([i]))
elif n1 == 2:
    b0, b1 = b[0], b[1]
    z0, z1 = z[0], z[1]
    for i in b0:
        h0 = z0 * i % mod
        for j in b1:
            h1 = z1 * j % mod + h0
            h1 %= mod
            d[h1].append((i, j))
else:
    b0, b1, b2 = b[0], b[1], b[2]
    z0, z1, z2 = z[0], z[1], z[2]
    for i in b0:
        h0 = z0 * i % mod
        for j in b1:
            h1 = z1 * j % mod + h0
            h1 %= mod
            for l in b2:
                h2 = z2 * l % mod + h1
                h2 %= mod
                d[h2].append((i, j, l))
if n2 == 1:
    b0 = b[n1]
    z0 = z[n1]
    for i in b0:
        h0 = z0 * i % mod
        if (h - h0) % mod in d:
            s = []
            for u in d[(h - h0) % mod]:
                for v in u:
                    s.append(v)
            s.append(i)
            solve(s)
elif n2 == 2:
    b0, b1 = b[n1], b[n1 + 1]
    z0, z1 = z[n1], z[n1 + 1]
    for i in b0:
        h0 = z0 * i % mod
        for j in b1:
            h1 = z1 * j % mod + h0
            h1 %= mod
            if (h - h1) % mod in d:
                s = []
                for u in d[(h - h1) % mod]:
                    for v in u:
                        s.append(v)
                s.append(i)
                s.append(j)
                solve(s)
else:
    b0, b1, b2 = b[n1], b[n1 + 1], b[n1 + 2]
    z0, z1, z2 = z[n1], z[n1 + 1], z[n1 + 2]
    for i in b0:
        h0 = z0 * i % mod
        for j in b1:
            h1 = z1 * j % mod + h0
            h1 %= mod
            for l in b2:
                h2 = z2 * l % mod + h1
                h2 %= mod
                if (h - h2) % mod in d:
                    s = []
                    for u in d[(h - h2) % mod]:
                        for v in u:
                            s.append(v)
                    s.append(i)
                    s.append(j)
                    s.append(l)
                    solve(s)
print(-1)