#include<iostream>
#include<cassert>
#include<ctime>
#include<climits>
#include<queue>
#include<fstream>
#include<deque>
#include<iomanip>
#include<list>
#include<stack>
#include<sstream>
#include<string>
#include<cctype>
#include<cstdio>
#include<vector>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#include<map>
#include<set>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define EPS 1e-10
#define F first
#define S second
#define all(n) n.begin(),n.end()
#define pb push_back
#define insert(a,b,c,d) PP(P(a,b),P(c,d))
#define INF (1<<27)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<P,P> PP;
const int dx[4] = {0,1,0,-1};
const int dy[4] = {1,0,-1,0};
const int MAX = 1000010;
bool prime[MAX+2];




class AOJ2048{
private:
  int a,b;
  vector<int> A,B;
public:
  AOJ2048(int a,int b):a(a),b(b){}
   
 

  vector<int> div(int num){
    vector<int> vec;
    for(int i=2;i<=num/2+1;i++){
      if(num%i == 0){
	vec.pb(i);
	//cout << "pre " << num << endl;
	while(num%i == 0)
	  num = num/i;
	//cout << "after " << num << endl << endl;
	if(num == 1)break;
      }
    }
    if(num != 1)vec.pb(num);
    // rep(i,vec.size()){
    //cout <<"vec = " << vec[i] << endl;
    // }
    return vec;
  }

  void run(){
   
    A = div(a);
    B = div(b);
    ll totalA,totalB;
    totalA = totalB = 0;
    int maxa,maxb;
    maxa=maxb=0;
    rep(i,A.size()){
      if(prime[A[i]]){
	maxa = max(maxa,A[i]);
	totalA += A[i];
      }
      //cout << "a = " << A[i] << endl;
    }    

    rep(i,B.size()){
      if(prime[B[i]]){
      maxb = max(maxb,B[i]);
      totalB += B[i];
      }
    }    
    totalA -= maxa;
    maxa -= totalA;
    totalB -= maxb;
    maxb -= totalB;
    if(maxa > maxb){
      cout << 'a' << endl;
    }
    else cout << 'b' << endl;

  }


};

void eratos(){
  rep(i,MAX+1)prime[i] = false;
  for(int i=3;i<=MAX;i+=2)prime[i] = true;
  prime[2] = true;
  int lim = (int)sqrt((double)MAX)+1;
  for(int i=3;i<=lim;i+=2){
    if(!prime[i])continue;
    for(int j=i+i;j<=MAX;j+=i)prime[j] = false;
  }
}

int main(){
  int Aa,Ba;
    eratos();
  
    while(true){
      cin >> Aa >> Ba;
      if(Aa+Ba == 0)break;
      AOJ2048 ans = AOJ2048(Aa,Ba);
      ans.run();
    }
return 0;
}