require 'prime'

### constant

MAX_N = 10 ** 6
MAX_P = 10 ** 3

### subroutines

def key(n)
  sum = 0
  lp = 0

  Prime.each do |pn|
    break if pn * pn > n
    if n % pn == 0
      sum += pn
      lp = pn
      while n % pn == 0
        n /= pn
      end
    end
  end

  if n > 1
    sum += n
    lp = n
  end

  2 * lp - sum
end

### main

loop do
  a, b = gets.split.map(&:to_i)
  break if a == 0
  
  ka = key(a)
  kb = key(b)

  puts (ka > kb) ? "a" : "b"
end