#include <iostream>
#include <cstdio>
using namespace std;

int main() {
  char x;
 NEXT:
  while(1) {
    if(cin.eof()) {goto END;}
    cin.get(x);
    if(x == '1') {
      break;
    }
  }
  cin.get(x);
  if(x == '1') {// A,C,E,G
    cin.get(x);
    if(x == '1') // C
      cout << "C" << endl;
    else if(x == '0') {//A,E,G
      for(int i=0;i<6;i++){
        cin.get(x);
      }
      if(x == '1')
        cout << "G" << endl; // G
      else if(x == '0') {
        cin.get(x);
        if(x == '1')
          cout << "A" << endl; // A
        else
          cout << "E" << endl; // E
      }
    }
  }
  else if(x == '0') {//B,D,F
    for(int i=0;i<6;i++) {
      cin.get(x);
    }
    if(x == '1')
      cout << "D" << endl;
    else if(x == '0') {
      cin.get(x);
      cin.get(x);
      if(x == '1')
        cout << "F" << endl;
      else
        cout << "B" << endl;
    }
  }
  while(1){
    cin.get(x);
      if(x == '\n') {
        cin.get(x);
        if(x == '\n')
          goto NEXT;
      }
  }
 END:
  return 0;
}