Decimal#2653

Decimal

4 seconds
64 megabytes
Medium

A rational number is a number that can be expressed as a ratio of two integers. Furthermore, all rational numbers can be written as a decimal with a repeating periodic part (in some cases the repeating part is ). For example, 1/7 = 0.1428571428571428...with repeating infinitely. Some fractions have a finite number of non-repeating digits before the periodic part begins. For instance, 1/6 = 0.166666...starts with and then repeats .

Your task is to write a program that takes four integers: , , lowerLength, and upperLength. Your program must find all integers between and (inclusive) such that the repeating part of the decimal representation of has between lowerLength and upperLength digits (inclusive). You should return the count of such numbers and list all of them in increasing order.

Input

The first line contains an integer (1 \leq lower \leq 1000000). The second line contains an integer (1 \leq upper \leq 1000000). The difference between and will be at most .

The third line contains an integer lowerLength (1 \leq lowerLength \leq 1000000). The fourth line contains an integer upperLength (1 \leq upperLength \leq 1000000). upperLength will be greater than or equal to lowerLength.

Output

Print the number of found integers in the first line. Then print these numbers in increasing order, one per line.

Examples

Example 1

Loading
Loading