This page is still under construction.

Parts of this page are still being built. What you see may change.

Steve Jobsoong

Time limit1sMemory limit128 MB

Summary
Find every natural number below 10^8 whose product with the given X moves its first digit to the last position.
Level

Medium6 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

Steve Jobsoong opens every talk with a math trick to pull the audience in.

His first trick is that the square root of a number is the back half of its digits. (25=5\sqrt{25} = 5, 5776=76\sqrt{5776} = 76)

His second trick is that multiplying a number by X=2.6X = 2.6 gives the number you get by moving its first digit to the last position. (135×2.6=351135 \times 2.6 = 351, 270270×2.6=702702270270 \times 2.6 = 702702)

The audience went wild over the second trick, so Jobsoong wants to know whether some XX other than 2.62.6 has the same property.

Given XX, write a program that finds every number whose product with XX equals the number obtained by moving its first digit to the last position.

Input

The first line contains XX. (1≤X<10001 \le X < 1000)

XX is given with at most four digits after the decimal point.

Output

Print every natural number smaller than 10810^8 whose product with XX equals the number obtained by moving its first digit to the last position, one per line in increasing order.

If no such number exists, print No solution.

Examples2

  1. Example 1

    Input
    2.6
    
    Expected output
    135
    270
    135135
    270270
    
  2. Example 2

    Input
    3.1416
    
    Expected output
    No solution