#include <stdio.h>

int isPalindrome(int x) {
    int reversed = 0;
    int original = x;

    while (x > 0) {
        reversed = reversed * 10 + x % 10;
        x /= 10;
    }

    return original == reversed;
}

void loop(int a, int b) {
	int i;
    for (i = a; i <= b; i++) {
        if (isPalindrome(i)) {
            printf("%d\n", i);
        }
    }
}

int main() {
    int a, b;
    scanf("%d %d", &a, &b);

    loop(a, b);

    return 0;
}
