#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,i,a,b,c,d;
	cin>>n>>i;
	for(;n<=i;n++){
		a=n/1000;
		b=n%1000/100;
		c=n%100/10;
		d=n%10;
		if(a!=0){
			if((a-b)==(b-c)&&(b-c)==(c-d)){
			cout<<n<<endl;
			}
		}
		else{
			if((b-c)==(c-d)){
			cout<<n<<endl;
			}
		}		
	}
return 0;
}

/**************************************************************
	Problem: 1466
	User: houshanglin
	Language: C++
	Result: Accepted
	Time:21 ms
	Memory:2072 kb
****************************************************************/