Finding a Multiple

No attempts yetTime limit1sMemory limit128 MB

Problem

Given a positive integer $n$, consider a positive integer $m$ that is a multiple of $n$ and whose decimal representation consists only of the digits 0 and 1. Such an $m$ always exists. Write a program that finds the smallest such $m$.

Here $n$ is a positive integer of at most 200, and the smallest valid $m$ has at most 100 digits.

Input

The input consists of several test cases. Each line contains one integer $n$ ($1 \le n \le 200$). The last line contains $0$ and must not be processed.

Output

For each test case, print on its own line the smallest $m$ that satisfies the condition.