Digital Content Protection

No attempts yetTime limit2sMemory limit128 MB

Problem

Dan works for a digital content protection company. The company protects the content of blu-ray discs under a standard called Anti Content Misuse (ACM).

The ACM standard works as follows. Suppose there are 2n2^n blu-ray players. Each player is one leaf of a complete binary tree of height nn, so every root to leaf path uses exactly nn edges. Every node uu of the tree carries an identifier number and holds a random key kuk_u. Identifiers are assigned this way. The root rr gets 11, and an internal node numbered ii has left child 2i2i and right child 2i+12i+1. This gives every node a distinct number. Blu-ray users never see the keys inside the nodes, but the manufacturers know them. Each player is identified by the number ii (2ni2n+112^n \le i \le 2^{n+1}-1) of its leaf, and the manufacturer embeds in player ii every key on the path from the root to leaf ii.

To encrypt a disc, the company generates a random key kk called the master key. It encrypts kk with the root key krk_r and writes the result on the disc as a header, then encrypts the content with kk and writes the encrypted data on the disc. A player decrypts the header with its own copy of krk_r, recovers the master key kk, and decrypts the content with kk.

Hackers extracted the keys embedded in a set RR of players and published them on the web, so none of those keys can protect the master key any more. Every player holds krk_r, so the scheme above is broken. The ACM standard covers this case. The header grows, but the content of a new disc stays safe. The company picks a set KK of keys that were not exposed, such that every player outside RR holds at least one key of KK. It encrypts the master key kk separately with each key kKk' \in K and puts the K|K| ciphertexts in the header. Every player that was not hacked then decrypts at least one ciphertext of the header and recovers kk. The smaller K|K| is, the shorter the header. Given the identifiers of the hacked players, help Dan find a smallest KK.

Input

The input is a single test case on two lines. The first line contains two integers nn and R|R| (1n621 \le n \le 62, 1R10001 \le |R| \le 1000), where R|R| is the size of the set RR of exposed players. The second line contains the R|R| identifiers of the exposed players. At least one player was not hacked.

Output

For a set KK that meets the requirements above and has minimum size, print the identifiers of the nodes holding the keys of KK in increasing order, separated by single spaces. Exactly one set of minimum size meets the requirements.