#include <iostream>

using namespace std;

int reverse (int n){
	int a = 0, b = 0;
	while (n != 0){
		a = n % 10;
		n /= 10;
		b = b * 10 + a;
	} 
	return b;
}

int main () {
	for (int i = 1000; i <= 9999; i++){
		if (i * 9 == reverse(i)){
			cout << i << endl;
		}
	}
	return 0;
}