def make(a, b)
  (["A"]*a+["B"]*b).permutation.map{|s| s.join}.uniq!
end
def make2(a, b)
  if a == 5
    make(a-1, b).map{|s| s + "A"}
  else
    make(a, b-1).map{|s| s + "B"}
  end
end
a, b = gets.split.map(&:to_i)
if a <= 4 && b <= 4
  arr = make(a, b)
elsif (a == 5 || b == 5) && a + b < 10
  arr = make2(a, b)
else
  x = make2(5, 4)
  y = make2(4, 5)
  if a == 5 && b == 5
    arr = (x.map{|s| s + "B"} + y.map{|s| s + "A"}).sort
  elsif a == 6
    arr = x.map{|s| s + "A"}
  else
    arr = y.map{|s| s + "B"}
  end
end
arr.each{|res| puts res}