#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll ilen(ll x){
	int ans=0;
	while(x){
		ans++;
		x/=10;
	}
	return ans;
} 
bool check(ll x,ll len){
	int vis[len];
	while(x){
		ll z=x%10;
		if(z>=len){
			return false;
		}
		vis[z]++;
		x/=10;
	}
	for(int i=0;i<len;i++){
		if(vis[i]!=1){
			return false;
		}
	}
	return true;
}
ll a[1000005];
int main(){
	ll l,r,ans=0;
	cin>>l>>r;
	for(ll i=l;i<=r;i++){
		if(check(i,ilen(i))==true){
			ans++;
			cout<<i<<endl;
		}
	}
	cout<<ans;
	return 0;
}