A = [0b11000000, 0b11000000]
B = [0b10000000, 0b10000000, 0b10000000, 0b10000000]
C = [0b11110000]
D = [0b01000000, 0b11000000, 0b10000000]
E = [0b11000000, 0b01100000]
F = [0b10000000, 0b11000000, 0b01000000]
G = [0b011000000, 0b11000000]

def match(source, target, width)
  return false  if source.length != target.length
  
  (9 - width).times{|n|
    found = true
    source.length.times{|l|
      found = false   if source[l] ^ target[l] >> n != 0
    }
    return true  if found
  }
  return false
end

def cutFigure(figure)
  subFigure = Array.new
  figure.each{|n|
    subFigure << n  if n != 0
  }
  return subFigure
end

def findFigure(source)
  return "A"  if match(source, A, 2)
  return "B"  if match(source, B, 1)
  return "C"  if match(source, C, 4)
  return "D"  if match(source, D, 2)
  return "E"  if match(source, E, 3)
  return "F"  if match(source, F, 2)
end


loop do
  figure = Array.new
  8.times{
    figure << $stdin.gets.to_i(2)
  }
  puts findFigure(cutFigure(figure))
  break if $stdin.gets != "\n"
end