#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)n; ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cout<<*i<<" "; cout<<endl; }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int eval(int n){
  vector<int> primes;
  for(int i = 2; i <= n ; i++){
    if(n%i==0){
      primes.push_back(i);
      while(n%i==0)n/=i;
    }
  }
  int res = primes.back();
  REP(i,primes.size()-1){
    res -= primes[i];
  }
  return res;
}
int main(){
  int a,b;
  while(cin>>a>>b,a||b){
    if(eval(a)<eval(b))cout<<"b"<<endl;
    else cout<<"a"<<endl;
  }

  return 0;
}