As you know, our ACM chairperson SSS is a big fan of huge bases :P Therefore, for him, the original 10 digits are insufficient. So he invents a new way of writing numbers, called as 'SSS number system', in which numbers consist of digits 0...9 and Latin letters A..Z where A equals 10, B equals 11, etc. He has challenged you that given a number in the SSS number system, return him the least number k, such that the given number when written in k-based system is divisible by k-1.
Input:
Input consists of one string comprising of digits or uppercase Latin letters.
Output:
Print the only number k. If for all 2 <= k <= 36, the condition written above cannot be satisfied, print "No Solution." . Answer should be written in the decimal system.
Constraints:
length of input string <= 10^6