Restored statement: the original English problem page was not recovered. This version is reconstructed from the official analysis and archived input/output data.
Farmer John is continuing Bessie's number theory bedtime reading. For a positive integer n, let s(n) be the sum of its proper divisors (all positive divisors smaller than n). Repeatedly applying s produces an aliquot sequence. For example, starting with 12 gives 12, 16, 15, 9, 4, 3, 1.
A cycle starting at n is a sequence that eventually returns to n. For every starting integer in a given inclusive range, find and print its cycle if the sequence returns to that starting integer without first reaching a smaller integer. Each cycle is printed once, beginning with its starting integer. A cycle may contain numbers larger than the upper end of the input range.
Input
- Line 1: Two integers,
AandB$(1 \le A \le B \le 2,000,000)$.
Output
For each starting integer in the input range whose aliquot sequence returns to it before reaching a smaller value, print the sequence on one line, with its integers separated by spaces.
Examples
Input 1
200 1200
Output 1
220 284
496
1184 1210
Problem credits: Traditional; Year: 2006.