A rational number is a number which can be expressed as a ratio of two integers. In addition, all rational numbers can be expressed as a decimal number with some repeating periodic part (in some cases the repeating part is 0). For example 1/7 = 0.1428571428571428... with 142857 repeating itself infinitely. Other fractions have some finite number of non-repeating digits before the periodic part begins. For example, 1/6 = 0.166666... starts with a 1 and then settles into repeating 6's.
Your task is to write a program that takes four int's: lower, upper, lowerLength, and upperLength. Your program must find all integers n between lower and upper, inclusive, where the repeating portion of the decimal representation of 1/n has between lowerLength and upperLength digits, inclusive. You should return quantity and all of the numbers you find sorted in increasing order.
First line contains integer lower (1 ≤ lower ≤ 1000000). Second line contains integer upper (1 ≤ upper ≤ 1000000). The difference between upper and lower will be at most 100.
Third line contains integer lowerLength (1 ≤ lowerLength ≤ 1000000). Fourth line contains integer upperLength (1 ≤ upperLength ≤ 1000000). upperLength will be greater than or equal to lowerLength.
Write on the first line of output amount of numbers you find. Write numbers in increasing order. Put one number in a line.