You are given two non-negative integers $p$ and $m$ written in base $b$. Write a program that computes the remainder of $p$ divided by $m$ and prints it in base $b$.
Here, the remainder of $p$ divided by $m$ is the smallest non-negative integer $k$ such that $p = a \cdot m + k$ for some integer $a$.
The input consists of several test cases. Each test case is given on a single line as three integers $b$, $p$, and $m$, separated by spaces.
The last line contains a single $0$, which marks the end of the input.
For each test case, print the remainder of $p$ divided by $m$ in base $b$ on its own line.