FIGURE = [18, 48, 6, 30, 20, 34, 16]
loop do
  map = 8.times.map{ gets.chars.map(&:to_i) }
  base, *dots = 4.times.map do
    y = map.index{|i| i.include?(1)}
    x = map[y].index(1)
    map[y][x] = 0
    [x,y]
  end
  points = dots.inject(0){|sum,(x,y)| sum + (x-base[0]) + (y-base[1])*8}
  ans = 'A'
  FIGURE.index(points).times{ ans = ans.next }
  puts ans
  break unless gets
end