ans = {}
ans[[[0, 1], [1, 0], [1, 1]]] = "A"
ans[[[1, 0], [2, 0], [3, 0]]] = "B"
ans[[[0, 1], [0, 2], [0, 3]]] = "C"
ans[[[1,-1], [1, 0], [2,-1]]] = "D"
ans[[[0, 1], [1, 1], [1, 2]]] = "E"
ans[[[1, 0], [1, 1], [2, 1]]] = "F"
ans[[[0, 1], [1,-1], [1, 0]]] = "G"

arr = $stdin.read.split("\n")

m = arr.size
i = 0
while i < m
  pos = []
  8.times{|j|
    8.times{|k|
      if arr[i][k] == "1"
        pos << [j, k]
      end
    }
    i += 1
  }
  1.upto(3){|j|
    pos[j][0] -= pos[0][0]
    pos[j][1] -= pos[0][1]
  }
  pos.shift
  puts ans[pos]
  i += 1
end