#P1988. 火炬

火炬

Description

At the 2008 Beijing Olympics, you want to become a torchbearer in Wenchuan, Sichuan. After multiple rounds of selection, you finally reach the last challenge.

This challenge is a hard problem: Given any positive integer NN, find the smallest positive integer MM such that the decimal representation of N×MN \times M contains only 1 and 0.

Input Format

One line containing a positive integer NN.

Output Format

Output one line. If a solution exists, output an integer representing the smallest MM, otherwise output No Solution.

12
925

Hint

Constraints: 1N1051 \le N \le 10^5.

Translated by ChatGPT 5