// Original C++ solution (slower):
#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <cmath>

#include <climits>

#include <cfloat>

#include <ctime>

#include <map>

#include <utility>

#include <set>

#include <iostream>

#include <memory>

#include <string>

#include <vector>

#include <algorithm>

#include <functional>

#include <sstream>

#include <complex>

#include <stack>

#include <queue>

#include <numeric>

#include <list>



using namespace std;



#ifdef _MSC_VER

#define __typeof__ decltype

template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }

#endif



#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)

#define all(c) (c).begin(), (c).end()

#define rall(c) (c).rbegin(), (c).rend()

#define popcount __builtin_popcount



#define rep(i, n) for (int i = 0; i < n; ++i)



template <class T> void max_swap(T& a, const T& b) { a = max(a, b); }

template <class T> void min_swap(T& a, const T& b) { a = min(a, b); }



typedef long long ll;

typedef pair<int, int> pint;





const int MAX = 1000000;

//bool is_prime[MAX + 10];

//

int memo[MAX + 10];

int key(int n)

{

	//if (is_prime[n])

	//	return n;

	if (~memo[n])

		return memo[n];



	int sum = 0, last;

	for (int i = 2; i <= n; ++i)

	{

		if (n % i == 0)

		{

			sum += i, last = i;

			while (n % i == 0)

				n /= i;

		}

	}

	return memo[n] = 2*last - sum;

}

int main()

{

	//fill_n(is_prime, MAX, true);

	//for (int i = 2; i*i <= MAX; ++i)

	//	if (is_prime[i])

	//		for (int j = 2*i; j <= MAX; j += i)

	//			is_prime[j] = false;



	fill_n(memo, MAX, -1);

	int a, b;

	while (scanf("%d%d", &a, &b), a | b)

		puts(key(a) > key(b) ? "a" : "b");

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <cmath>

#include <climits>

#include <cfloat>

#include <ctime>

#include <map>

#include <utility>

#include <set>

#include <iostream>

#include <memory>

#include <string>

#include <vector>

#include <algorithm>

#include <functional>

#include <sstream>

#include <complex>

#include <stack>

#include <queue>

#include <numeric>

#include <list>



using namespace std;



#ifdef _MSC_VER

#define __typeof__ decltype

template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }

#endif



#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)

#define all(c) (c).begin(), (c).end()

#define rall(c) (c).rbegin(), (c).rend()

#define popcount __builtin_popcount



#define rep(i, n) for (int i = 0; i < n; ++i)



template <class T> void max_swap(T& a, const T& b) { a = max(a, b); }

template <class T> void min_swap(T& a, const T& b) { a = min(a, b); }



typedef long long ll;

typedef pair<int, int> pint;





const int MAX_PRIME = 1000;

bool is_prime[MAX_PRIME + 1];

void sieve()

{

	fill_n(is_prime, MAX_PRIME + 1, true);

	is_prime[0] = is_prime[1] = false;

	for (int i = 2; i * i <= MAX_PRIME; ++i)

	{

		if (is_prime[i])

		{

			for (int j = 2 * i; j <= MAX_PRIME; j += i)

				is_prime[j] = false;

		}

	}

}

int key(int n)

{

	int sum = 0, last;

	for (int i = 2; i <= MAX_PRIME; ++i)

	{

		if (is_prime[i] && n % i == 0)

			sum += i, last = i;

		while (n % i == 0)

			n /= i;

	}

	if (n > 1)

		sum += n, last = n;

	return last * 2 - sum;

}

int main()

{

	sieve();



	int a, b;

	while (scanf("%d%d", &a, &b), a | b)

		puts(key(a) > key(b) ? "a" : "b");

}

// Fastest known solution for this problem: