#include <bits/stdc++.h>

using namespace std;

int func(int n)
{
    int sum = 0, largest = 0;
    for (int i = 2; i <= n; i++) {
        if (n % i == 0) {
            sum += i;
            largest = i;
            while (n % i == 0) {
                n /= i;
            }
        }
    }
    sum -= largest;
    return largest - sum;
}

int main()
{
    int a, b;
    while (cin >> a >> b, a) {
        if (func(a) > func(b)) {
            cout << 'a' << endl;
        } else {
            cout << 'b' << endl;
        }
    }        
    return 0;
}