#include <iostream>
#include <vector>
#include <queue>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    int S, E;
    cin >> S >> E;
    vector<int> pals; // ke gi imame site palindromi od 3 do 99999
    for(int i = 3; i <= 99999; i++) {
        int tmp = i;
        vector<int> v;
        while(tmp > 0) {
            v.push_back(tmp % 10);
            tmp /= 10;
        }
        int L = 0;
        int R = v.size() - 1;
        bool flag = true;
        while(L < R) {
            if(v[L] != v[R]) {
                flag = false;
                break;
            }
            L += 1;
            R -= 1;
        }
        if(flag) {
            pals.push_back(i);
        }
    }
    vector<bool> visited(100000, false);
    visited[S] = true;
    queue<int>  q;
    q.push(S); // momentalniot broj
    q.push(0); // brojot na cekori da stigneme od S do momentalniot broj
    
    return 0;
}

// S --> E
// S + palindrome <= E
