import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.container;
import std.datetime;

void main()
{
	foreach (line; stdin.byLine) {
		auto x = line.chomp;
		if (x.length == 0) continue;
		auto f = new string[](10);
		f[0] = f[9] = "0000000000";
		f[1] = "0" ~ line.to!string ~ "0";
		foreach (i; 2..9) {
			f[i] = "0" ~ readln.chomp ~ "0";
		}
		bool ff;
		foreach (i; 1..9) {
			foreach (j; 1..9) {
				if (f[i][j] == '0') continue;
				if (f[i+1][j-1] == '1' && f[i][j+1] == '1') writeln("G");
				else if (f[i+1][j-1] == '1') writeln("D");
				else if (f[i][j+1] == '1' && f[i+1][j] == '1') writeln("A");
				else if (f[i][j+1] == '1' && f[i+1][j+1] == '1') writeln("E");
				else if (f[i+1][j] == '1' && f[i+1][j+1] == '1') writeln("F");
				else if (f[i+1][j] == '1') writeln("B");
				else if (f[i][j+1] == '1') writeln("C");
				ff = 1;
				break;
			}
			if (ff) break;
		}
	}
}