Stairs numbers


Submit solution

Points: 35
Time limit: 1.0s
Python 3 6.0s
Memory limit: 256M

Author:
Problem type

Stairs numbers are natural numbers where the absolute difference between any two adjacent digits is exactly \(1\). For example \(321\) and \(456\) are stairs numbers, but not \(112\) or \(136\).

Given two integers \(l\) and \(r\) we want you to print all stair numbers \(x \in [L,R[\), in an increasing order.

Input Specification

Input consists of one line with two integers \(L, R\) (\(1 \leq L,R \leq 10^{9}\)).

Output Specification

Output stairs numbers, one in a line, in an increasing order.

Sample Input

1 10

Sample Output

1
2
3
4
5
6
7
8
9

Comments

There are no comments at the moment.