#coding:utf-8


def  surface(tmp)
	str = String.new
	a = tmp[0]
	b = tmp[1]
	c = tmp[2]
	d = tmp[3]

	if (c==a+8 && d==b+8 && b==a+1 && d==c+1) then str = "A"
	elsif (b==a+8 && c==b+8 && d==c+8 &&a==d-24) then str = "B"
	elsif (b==a+1 && c==b+1 && d==c+1 && a==d-4) then str ="C"	
	elsif (b==a+7 && c==b+1 && d==b+8 && a==d-15) then str = "D"
	elsif (b==a+1 && c==b+8 && d==c+1 && a==d-10) then str = "E"
	elsif (b==a+8 && c==b+1 && d==c+8 && a==d-17) then str = "F"
	elsif (b==a+1 && c==b+6 && d==c+1 && a==d-8) then str = "G"
	end

	return str
end

while !STDIN.eof? do
	pos = Array.new
	tmp = Array.new

	#getting a surface
	0.upto(7) {|i|
		str = gets.chomp.split('').map(&:to_i)
		#行から'1'を探す. 
		pos = str.each_with_index.select{|x| x[0]==1}.map{|x| x[1]}
		if pos.empty? then next end
		
		tmp << pos.map{|x| x+(i*8)}
		
	}
	gets
	
	tmp.flatten!
	puts surface(tmp)
	
	

end