#include <bits/stdc++.h>
using namespace std;
int l[10]={0};
bool check(int x){
	int t=x,s=0,wz;
//	cout<<x<<" ";
	while(1){
		if(t==0)break;
		int y=t%10;
		t/=10;
		s++;
//		cout<<y<<" ";
		l[y]=1;
		if(y==0){
			wz=s;
		}
	}
	int js=0;
	if(wz==s)return false;
	for(int i=0;i<=9;i++){
		if(l[i]>0&&i>=s){
			return false;
		}
		if(l[i]>0)js++;
	}
	if(js==s)return true;
	else return false;
}
int main()
{
	int a,b,s=0;
	cin>>a>>b;
	for(int i=a;i<=b;i++){
		memset(l,0,sizeof(l));
		if(check(i)){
			cout<<i<<endl;
			s++;
		} 
//		cout<<endl;
	}
	cout<<s;
	return 0;
}