#include <iostream>
#include <vector>
#include <set>
#include <cmath>

using namespace std;
bool IsPrime[1005000];
vector<int> Prime;

void PrimeCalc()
{
	for(int i = 0; i < 1005000; ++i)
	{
		IsPrime[i] = true;
	}
	for(int i = 2; i < 1005000; ++i)
	{
		if(IsPrime[i])
		{
			Prime.push_back(i);
			for(int j = i * 2; j < 1005000; j += i)
			{
				IsPrime[j] = false;
			}
		}
	}
}

int func(int a)
{
	set<int> Set;
	for(int i = 0; Prime[i] <= a; ++i)
	{
		if(a % Prime[i] == 0)
		{
			Set.insert(Prime[i]);
		}
	}
	int sum = 0;
	set<int>::iterator It;
	for(It = Set.begin(); It != Set.end(); ++It)
	{
		sum -= *It;
	}
	--It;
	sum += *It * 2;
	return(sum);
}

void solve()
{
	PrimeCalc();
	int a, b;
	while(cin >> a >> b, a || b)
	{
		int A = func(a);
		int B = func(b);
		A < B ? cout << "b" : cout << "a";
		cout << endl;
	}
}

int main()
{
	solve();
	return(0);
}