#include <iostream>
using namespace std;
bool is_good(int x)
{
    int a,b;
	b = -1;
	while (x>0)
	{
		a = x % 10;
		if (a == b)
		{
			return true;
		}
		x/=10;
		b = a;
	}
	return false;
}
int main()
{
	for (int i=0;i<=9999;i++)
	{
		bool e = true;
		for (int j=11;j<=i/2;j++)
		{
			if (is_good(j) && is_good(i-j))
			{
				e = false;
				break;
			}
		}
		if (e) cout<<i<<endl;
	}
	return 0;
}