#P96. 近似排序

近似排序

题目描述

写一个程序,从输入文件读入一对正整数,将这两个数之间(包括这两个数本身)的所有数按下述特别规则排序后输出。该特别规则是按两数倒过来的值进行比较决定其大小,如30倒过来为3,29倒过来为92,则29大于30。如果两数倒过来的值相同则原数小的先输出,如3和30倒过来都为3,但先输出3再输出30。

Write a program that reads a pair of positive integers from the input file, sorts those integers and the integers between them according to the reversal of their digits, and then prints those numbers, one number per line. The sort should print the smallest number first, largest number last. If two numbers reverse to the same number (e.g., 3 and 30, the smaller unreversed one should appear first in the output).

输入格式

单独一行包含二个用空格隔开的自然数,这二个自然数给出了待排序数的范围,其中1<=第一个数<=第二个数<=999999999,两个数之差不超过100。

输出格式

排序的结果

样例

样例数据

input

22 39

output

30
31
22
32
23
33
24
34
25
35
26
36
27
37
28
38
29
39

限制与提示

时间限制:1s1 \text {s}

空间限制:256MB256 \text {MB}