#include <algorithm>
#include <bitset>
#include <iostream>
#include <numeric>
#include <vector>

using namespace std;

int main()
{
    bitset<1000100 + 1> b;
    auto t = b;
    t.set();
    t[0] = false;
    t[1] = false;
    int i = 0;
    while (true) {
        bool done = false;
        while (!t[i]) {
            ++i;
            if (i == t.size()) {
                done = true;
                break;
            }
        }
        if (done) {
            break;
        }

        b[i] = true;
        for (int j = i; j < t.size(); j += i) {
            t[j] = false;
        }
    }

    while (true) {
        int a, bb;
        cin >> a >> bb;
        int aa = a;
        int bbb = bb;
        if (a == 0 && bb == 0) {
            return 0;
        }

        vector<int> pa;
        int j = 2;
        while (true) {
            while (!b[j]) {
                ++j;
            }
            if (a == 1) {
                break;
            }
            if (a % j == 0) {
                pa.push_back(j);
                a /= j;
            }
            else {
                j += 1;
            }
        }
        vector<int> pb;
        j = 2;
        while (true) {
            while (!b[j]) {
                ++j;
            }
            if (bb == 1) {
                break;
            }
            if (bb % j == 0) {
                pb.push_back(j);
                bb /= j;
            }
            else {
                j += 1;
            }
        }
        pa.erase(unique(begin(pa), end(pa)), end(pa));
        pb.erase(unique(begin(pb), end(pb)), end(pb));

        auto f = [](const vector<int>& v) {
            auto s = accumulate(begin(v), --end(v), 0);
            return v.back() - s;
        };
        if (f(pa) > f(pb)) {
            cout << "a" << endl;
        }
        else {
            cout << "b" << endl;
        }
    }
}