#include <stdio.h>

int InvertSequence(int num) {
    int reversed = 0;
    while (num > 0) {
        reversed = reversed * 10 + num % 10;
        num /= 10;
    }
    return reversed;
}

int loop(int x) {
    if (x == InvertSequence(x)) {
        return 1; 
    } else {
        return 0; 
    }
}

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

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

    return 0;
}
