#include <stdio.h>
#include <cmath>
#include <algorithm>

#define NUM 1000500

int main(){
	int* table = new int[NUM];
	int limit;

	for(int i=0; i < NUM;i++)table[i] = 1;
	table[0] = 0;
	table[1] = 0;

	limit = sqrt(NUM);

	for(int i=2;i<=limit;i++){
		if(table[i] == 1){
			for(int k=2*i;k < NUM; k += i){
				table[k] = 0;
			}
		}
	}

	int a,b,index,array[1000],sum,a_key,b_key;

	while(true){
		scanf("%d %d",&a,&b);
		if(a == 0 && b == 0)break;

		limit = a/2 + 100;
		index = 0;

		for(int i = 2; i <= limit; i++){
			if(table[i] == 1 && a%i == 0){
				array[index++] = i;
				while(a%i == 0){
					a /= i;
				}
			}
		}

		sum = 0;

		if(index == 0 && table[a] == 1){
			a_key = a;
		}else{

			for(int i = 0; i <= index-2; i++){
				sum += array[i];
			}

			a_key = array[index-1] - sum;
		}


		limit = b/2 + 100;
		index = 0;

		for(int i = 2; i <= limit; i++){
			if(table[i] == 1 && b%i == 0){
				array[index++] = i;
				while(b%i == 0){
					b /= i;
				}
			}
		}

		sum = 0;

		if(index == 0 && table[b] == 1){
			b_key = b;
		}else{

			for(int i = 0; i <= index-2; i++){
				sum += array[i];
			}

			b_key = array[index-1] - sum;
		}

		if(a_key > b_key)printf("a\n");
		else{
			printf("b\n");
		}

	}
	return 0;
}