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

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define rep(i,s,n) for(int i=(s); i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define IN(x,s,g) ((x) >= (s) && (x) < (g))
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))
#define print(x) printf("%d\n",x)

using namespace std;

typedef unsigned int uint;
typedef long long ll;

const int _dx[] = {0,1,0,-1};
const int _dy[] = {-1,0,1,0};


/*
 * 0©çm-1ÜÅÌfÉÖ·éCu
 * templateÅTCYðwè·éÌÅá±¢?
 * Prime<1000> p; Å999ÜÅÌfÌe[uªÅ«é
 * p[k] : kÔÚÌfÍ½©
 * p.isPrime(k) : kªf©Ç¤©
 */
template<int m>
class Prime{
  std::vector<bool> p;
  std::vector<int> ps;
public:
  Prime(){
    p = std::vector<bool>(m,true);
    assert(m>1);
    p[0]=p[1]=false;
    for(int i=4;i<m;i+=2)
      p[i]=false;
    ps.push_back(2);
    for(int i=3;i<m;i+=2){
      if(p[i]){
        ps.push_back(i);
        for(int j=i+i;j<m;j+=i)
          p[j]=false;
      }
    }
  }

  bool isPrime(int n){
    assert(m>n);
    return p[n];
  }

  int operator [] (int n){
    if(n<ps.size()) return ps[n];
    else return 0;
  }

  int size(){
    return ps.size();
  }
};

int getInt(){
  int ret = 0,c;
  c = getchar();
  while(!isdigit(c)) c = getchar();
  while(isdigit(c)){
    ret *= 10;
    ret += c - '0';
    c = getchar();
  }
  return ret;
}

int main(){
  Prime<1001000> p;
  int a,b;
  while(a = getInt(), b = getInt(), a+b){
    int mp = 0;
    int i = 0;
    int ansa = 0;
    int ansb = 0;
    while(a >= p[i]){
      if(a % p[i] == 0){
        ansa -= p[i];
        mp    = p[i];
      }
      while(a % p[i] == 0)
        a /= p[i];
      i++;
    }
    ansa += mp + mp;

    mp = i = 0;
    while(b >= p[i]){
      if(b % p[i] == 0){
        ansb -= p[i];
        mp    = p[i];
      }
      while(b % p[i] == 0)
        b /= p[i];
      i++;
    }
    ansb += mp + mp;

    printf("%c\n",ansa > ansb ? 'a' : 'b');
  }
  return 0;
}