#include <bits/stdc++.h>

using namespace std;

#define LOG(...) fprintf(stderr,__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SQ(n) (n)*(n)

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

bool isprime[1000001] = {false};
int primes[80000] = {0};

int getval(int n){
  int maxn = 0;
  set<int> list;
  int i = 0;
  while(n != 1){
    // LOG("%d %d %d \n",i,primes[i], n);
    while(n % primes[i] == 0){
      maxn = max(maxn, primes[i]);
      list.insert(primes[i]);
      n /= primes[i];
    }
    i++;
  }

  int sum = maxn * 2;
  for(auto m : list){
    sum -= m;
  }
  return sum;
}

int main() {
  int cnt = 0;
  FOR(i, 2, 1000001){
    if(isprime[i]) continue;
    primes[cnt++] = i;
    for(int j = i * 2; j < 1000001; j += i){
      isprime[j]=true;
    }
  }

  int a, b;
  while(cin>>a>>b,a|b){
    if(getval(a)<getval(b)){
      cout << 'b' << endl;
    }else{
      cout << 'a' << endl;
    }
  }
}