Stamps

No attempts yetTime limit1sMemory limit128 MB

Problem

The government of Nova Mareterrania attaches revenue stamps to legal documents so that it can collect income from them. By recent law, each class of document may carry only a limited number of stamps. The government wants to decide how many stamp denominations to print, and of what values, so that the widest possible range of totals can be assembled within that limit. Every stamp is worth a whole number of dollars.

When a document may carry at most $h$ stamps and $k$ different denominations are available, let $n(h,k)$ be the largest value $N$ such that every amount from $1$ to $N$ can be formed using at most $h$ stamps. A denomination may be used more than once, and there is no limit on how many stamps of each denomination are available (only the total count $h$ is limited). One denomination is always $1$, since otherwise the amount $1$ could not be formed.

For example, with $h = 3$ and $k = 2$: using denominations $1$ and $4$ you can form every amount from $1$ to $6$, but using denominations $1$ and $3$ you can form every amount from $1$ to $7$. The second choice is better, so $n(3, 2) = 7$.

Given $h$ and $k$, choose the $k$ denominations that maximize $n(h,k)$, and report both the chosen denominations and the value $n(h,k)$.

Input

The input consists of several lines. Each line contains two integers $h$ and $k$ separated by a space, with $h \ge 1$, $k \ge 1$, and $h + k \le 9$.

The input ends with a line containing 0 0, which is not a query and must not be processed.

Output

For each query, print one line: the $k$ chosen denominations in ascending order, each right-justified in a field 3 characters wide, followed by a space, an arrow ->, and the value $n(h,k)$ right-justified in a field 3 characters wide.

Several different sets of denominations can reach the same maximum $n(h,k)$. When that happens, output the lexicographically smallest such set: compare the two ascending denomination sequences position by position and take the one whose value is smaller at the first position where they differ.