#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <functional>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
 
using namespace std;
 
#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb(n) push_back((n))
#define mp(n,m) make_pair((n),(m))
#define all(r) r.begin(),r.end()
#define fi first
#define se second
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
 
const int INF = 10000000;
const int mod = 1e9 + 7;
const double EPS = 1e-9;
 
const int MAX_N = (int)(1e6) +10;

vi isPrime(MAX_N, 1);
vi primes;

void setPrime(){
	isPrime[0] = isPrime[1] = 0;
	for(int i = 2; i < MAX_N; i++){
		if(isPrime[i]==1){
			primes.pb(i);
			for(int j = i + i; j < MAX_N; j += i){
				isPrime[i] = 0;
			}
		}
	}
}

vi func(int n){
	vi ret;
	for(int i = 0; i < primes.size() && primes[i] <= n; i++){
		while(n %primes[i] == 0){
			n /= primes[i];
			if(ret.size() == 0 || *ret.rbegin() != primes[i]){
				ret.pb(primes[i]);
			} 
		}
	}
	return ret;
}

int calc(vi v){
	int ret = 0;
	for(vi::iterator it = v.begin(); it != v.end(); it++){
		ret -= *it;
	}
	ret += *v.rbegin()*2;
	return ret;
}

int main(){
	setPrime();
	int a, b;
	while(cin>>a>>b){
		if(a == 0 && b == 0) break;
		// for(int i = 0; i < func(a).size(); i++){
		// 	cout<<" "<<func(a).at(i);
		// }
		// cout<<endl;
		// cout<<calc(func(a))<<" "<<calc(func(b))<<endl;
		if(calc(func(a)) > calc(func(b))) cout<<"a"<<endl;
		else cout<<"b"<<endl;
	}
}