#include <iostream>
using namespace std;
bool goodNum(int n)
{
int k = n % 10, d;
n = n / 10;
bool r = false;
while(n > 0)
d = n % 10;
if(d == k)
return true;
k = d;
}
return false;
int main()
int n;
cin >> n;
for(int i = 1; i <= n; i++)
if(goodNum(i))
cout << i << " ";
return 0;
#include <iostream>
using namespace std;
bool goodNum(int n)
{
int k = n % 10, d;
n = n / 10;
bool r = false;
while(n > 0)
{
d = n % 10;
if(d == k)
return true;
n = n / 10;
k = d;
}
return false;
}
int main()
{
int n;
cin >> n;
for(int i = 1; i <= n; i++)
if(goodNum(i))
cout << i << " ";
return 0;
}