There's no doubt about it, three is a magical number. Two's company, but three's a crowd, no one ever talks about blind mice, and there are three members in an ACM ICPC team.
Even more magically, almost all integers can be represented as a number that ends in in some numeric base, sometimes in more than one way. Consider the number , which is represented as in base and in base . For this problem, you will find the smallest base for a given number so that the number's representation in that base ends in .
Each line contains one nonnegative integer . The value n = 0 represents the end of the input and should not be processed. All input integers are less than 2^{31}. There are no more than nonzero values of .
For each nonzero value of print on a single line the smallest base for which the number has a representation that ends in . If there is no such base, print instead "No such base".
Example 1