#include <iostream>
using namespace std;

int main() {
  char x;
  int k=0;
  while(cin.get(x)) {
    if(x == 1) {
      k = k % 7;
      break;
    }
    k++;
  }
  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;
    }
  }
}