P10708 [HackerEarth] modified number
普及
题目描述

A modified KP number is a positive whole number n with d digits, such that when we split its square into two pieces - a right hand piece r with d digits and a left hand piece l that contains the remaining d or d−1 digits, the sum of the pieces is equal to the original number (i.e. l + r = n).

Note: r may have leading zeros.

Here's an explanation about the ORIGINAL KP Number. A KP number for a given base is a non-negative integer, the representation of whose square in that base can be split into two parts that add up to the original number again. For instance, 45 is a KP number, because 45² = 2025 and 20+25 = 45.

You are given the two positive integers p and q, where p is lower than q. Write a program to determine how many KP numbers are there in the range between p and q (both inclusive) and display them all.

INPUT

There will be two lines of input: p, lowest value q, highest value.

OUTPUT

Output each KP number in the given range, space-separated on a single line. If no KP numbers exist in the given range, print INVALID RANGE.

CONSTRAINTS

0<p<q<100000

SAMPLE INPUT
1
100

SAMPLE OUTPUT
1 9 45 55 99

输入格式

见题面

输出格式

见题面

样例输入
1 100 SAMPLE
样例输出
1 9 45 55 99