A Bell number \textbf{B}_n is the number of ways to partition a set of elements into disjoint, non-empty subsets. For example, \textbf{B}_3 = 5, because there are possible partitions of the set \{\textbf{a}, \textbf{b}, \textbf{c}\}: \{\{\textbf{a}\}, \{\textbf{b}\}, \{\textbf{c}\}\}, \{\{\textbf{a}, \textbf{b}\}, \{\textbf{c}\}\}, \{\{\textbf{a}, \textbf{c}\}, \{\textbf{b}\}\}, \{\{\textbf{a}\}, \{\textbf{b}, \textbf{c}\}\}, \{\{\textbf{a}, \textbf{b}, \textbf{c}\}\}.
Additionally, \textbf{B}_0 = 1.
Consider the determinant \textbf{D}_n depicted in the following figure:

Given a prime number , find the greatest integer such that \textbf{D}_n is divisible by p^k.
Each line contains two integers and (0 \le n,\, p \le 10000). It is guaranteed that is a prime number.
For each pair and , print on a separate line the greatest integer such that \textbf{D}_n is divisible by p^k.
Example 1