#include <bits/stdc++.h>
using namespace std;
int main() {
  string F, M, S;
  cin >> F >> M >> S;
  if ((F[0] == 'r') && (F[1] == 'o') && (F[2] == 'c') && (F[3] == 'k')) {
    if ((M[0] == 'r') && (M[1] == 'o') && (M[2] == 'c') && (M[3] == 'k')) {
      if ((S[0] == 'r') && (S[1] == 'o') && (S[2] == 'c') && (S[3] == 'k')) {
        cout << "?" << endl;
        return 0;
      }
    }
    if ((M[0] == 'p') && (M[1] == 'a') && (M[2] == 'p') && (M[3] == 'e') &&
        (M[4] == 'r')) {
      if ((S[0] == 'p') && (S[1] == 'a') && (S[2] == 'p') && (S[3] == 'e') &&
          (S[4] == 'r')) {
        cout << "?" << endl;
        return 0;
      }
    }
    if ((M[0] == 's') && (M[1] == 'c') && (M[2] == 'i') && (M[3] == 's') &&
        (M[4] == 's') && (M[5] == 'o') && (M[6] == 'r') && (M[7] == 's')) {
      if ((S[0] == 's') && (S[1] == 'c') && (S[2] == 'i') && (S[3] == 's') &&
          (S[4] == 's') && (S[5] == 'o') && (S[6] == 'r') && (S[7] == 's')) {
        cout << "F" << endl;
        return 0;
      }
    }
    if ((M[0] == 'r') && (M[1] == 'o') && (M[2] == 'c') && (M[3] == 'k')) {
      if ((S[0] == 'p') && (S[1] == 'a') && (S[2] == 'p') && (S[3] == 'e') &&
          (S[4] == 'r')) {
        cout << "S" << endl;
        return 0;
      }
    }
    if ((M[0] == 'r') && (M[1] == 'o') && (M[2] == 'c') && (M[3] == 'k')) {
      if ((S[0] == 's') && (S[1] == 'c') && (S[2] == 'i') && (S[3] == 's') &&
          (S[4] == 's') && (S[5] == 'o') && (S[6] == 'r') && (S[7] == 's')) {
        cout << "?" << endl;
        return 0;
      }
    }
    if ((M[0] == 'p') && (M[1] == 'a') && (M[2] == 'p') && (M[3] == 'e') &&
        (M[4] == 'r')) {
      if ((S[0] == 'r') && (S[1] == 'o') && (S[2] == 'c') && (S[3] == 'k')) {
        cout << "M" << endl;
        return 0;
      }
    }
    if ((M[0] == 's') && (M[1] == 'c') && (M[2] == 'i') && (M[3] == 's') &&
        (M[4] == 's') && (M[5] == 'o') && (M[6] == 'r') && (M[7] == 's')) {
      if ((S[0] == 'r') && (S[1] == 'o') && (S[2] == 'c') && (S[3] == 'k')) {
        cout << "?" << endl;
        return 0;
      }
    }
    if ((M[0] == 's') && (M[1] == 'c') && (M[2] == 'i') && (M[3] == 's') &&
        (M[4] == 's') && (M[5] == 'o') && (M[6] == 'r') && (M[7] == 's')) {
      if ((S[0] == 'p') && (S[1] == 'a') && (S[2] == 'p') && (S[3] == 'e') &&
          (S[4] == 'r')) {
        cout << "?" << endl;
        return 0;
      }
    }
    if ((M[0] == 'p') && (M[1] == 'a') && (M[2] == 'p') && (M[3] == 'e') &&
        (M[4] == 'r')) {
      if ((S[0] == 's') && (S[1] == 'c') && (S[2] == 'i') && (S[3] == 's') &&
          (S[4] == 's') && (S[5] == 'o') && (S[6] == 'r') && (S[7] == 's')) {
        cout << "?" << endl;
        return 0;
      }
    }
  }
  if ((F[0] == 'p') && (F[1] == 'a') && (F[2] == 'p') && (F[3] == 'e') &&
      (F[4] == 'r')) {
    if ((M[0] == 'r') && (M[1] == 'o') && (M[2] == 'c') && (M[3] == 'k')) {
      if ((S[0] == 'r') && (S[1] == 'o') && (S[2] == 'c') && (S[3] == 'k')) {
        cout << "F" << endl;
        return 0;
      }
    }
    if ((M[0] == 'p') && (M[1] == 'a') && (M[2] == 'p') && (M[3] == 'e') &&
        (M[4] == 'r')) {
      if ((S[0] == 'p') && (S[1] == 'a') && (S[2] == 'p') && (S[3] == 'e') &&
          (S[4] == 'r')) {
        cout << "?" << endl;
        return 0;
      }
    }
    if ((M[0] == 's') && (M[1] == 'c') && (M[2] == 'i') && (M[3] == 's') &&
        (M[4] == 's') && (M[5] == 'o') && (M[6] == 'r') && (M[7] == 's')) {
      if ((S[0] == 's') && (S[1] == 'c') && (S[2] == 'i') && (S[3] == 's') &&
          (S[4] == 's') && (S[5] == 'o') && (S[6] == 'r') && (S[7] == 's')) {
        cout << "?" << endl;
        return 0;
      }
    }
    if ((M[0] == 'r') && (M[1] == 'o') && (M[2] == 'c') && (M[3] == 'k')) {
      if ((S[0] == 'p') && (S[1] == 'a') && (S[2] == 'p') && (S[3] == 'e') &&
          (S[4] == 'r')) {
        cout << "?" << endl;
        return 0;
      }
    }
    if ((M[0] == 'r') && (M[1] == 'o') && (M[2] == 'c') && (M[3] == 'k')) {
      if ((S[0] == 's') && (S[1] == 'c') && (S[2] == 'i') && (S[3] == 's') &&
          (S[4] == 's') && (S[5] == 'o') && (S[6] == 'r') && (S[7] == 's')) {
        cout << "?" << endl;
        return 0;
      }
    }
    if ((M[0] == 'p') && (M[1] == 'a') && (M[2] == 'p') && (M[3] == 'e') &&
        (M[4] == 'r')) {
      if ((S[0] == 'r') && (S[1] == 'o') && (S[2] == 'c') && (S[3] == 'k')) {
        cout << "?" << endl;
        return 0;
      }
    }
    if ((M[0] == 's') && (M[1] == 'c') && (M[2] == 'i') && (M[3] == 's') &&
        (M[4] == 's') && (M[5] == 'o') && (M[6] == 'r') && (M[7] == 's')) {
      if ((S[0] == 'r') && (S[1] == 'o') && (S[2] == 'c') && (S[3] == 'k')) {
        cout << "?" << endl;
        return 0;
      }
    }
    if ((M[0] == 's') && (M[1] == 'c') && (M[2] == 'i') && (M[3] == 's') &&
        (M[4] == 's') && (M[5] == 'o') && (M[6] == 'r') && (M[7] == 's')) {
      if ((S[0] == 'p') && (S[1] == 'a') && (S[2] == 'p') && (S[3] == 'e') &&
          (S[4] == 'r')) {
        cout << "M" << endl;
        return 0;
      }
    }
    if ((M[0] == 'p') && (M[1] == 'a') && (M[2] == 'p') && (M[3] == 'e') &&
        (M[4] == 'r')) {
      if ((S[0] == 's') && (S[1] == 'c') && (S[2] == 'i') && (S[3] == 's') &&
          (S[4] == 's') && (S[5] == 'o') && (S[6] == 'r') && (S[7] == 's')) {
        cout << "S" << endl;
        return 0;
      }
    }
  }
  if ((F[0] == 's') && (F[1] == 'c') && (F[2] == 'i') && (F[3] == 's') &&
      (F[4] == 's') && (F[5] == 'o') && (F[6] == 'r') && (F[7] == 's')) {
    if ((M[0] == 'r') && (M[1] == 'o') && (M[2] == 'c') && (M[3] == 'k')) {
      if ((S[0] == 'r') && (S[1] == 'o') && (S[2] == 'c') && (S[3] == 'k')) {
        cout << "?" << endl;
        return 0;
      }
    }
    if ((M[0] == 'p') && (M[1] == 'a') && (M[2] == 'p') && (M[3] == 'e') &&
        (M[4] == 'r')) {
      if ((S[0] == 'p') && (S[1] == 'a') && (S[2] == 'p') && (S[3] == 'e') &&
          (S[4] == 'r')) {
        cout << "F" << endl;
        return 0;
      }
    }
    if ((M[0] == 's') && (M[1] == 'c') && (M[2] == 'i') && (M[3] == 's') &&
        (M[4] == 's') && (M[5] == 'o') && (M[6] == 'r') && (M[7] == 's')) {
      if ((S[0] == 's') && (S[1] == 'c') && (S[2] == 'i') && (S[3] == 's') &&
          (S[4] == 's') && (S[5] == 'o') && (S[6] == 'r') && (S[7] == 's')) {
        cout << "?" << endl;
        return 0;
      }
    }
    if ((M[0] == 'r') && (M[1] == 'o') && (M[2] == 'c') && (M[3] == 'k')) {
      if ((S[0] == 'p') && (S[1] == 'a') && (S[2] == 'p') && (S[3] == 'e') &&
          (S[4] == 'r')) {
        cout << "?" << endl;
        return 0;
      }
    }
    if ((M[0] == 'r') && (M[1] == 'o') && (M[2] == 'c') && (M[3] == 'k')) {
      if ((S[0] == 's') && (S[1] == 'c') && (S[2] == 'i') && (S[3] == 's') &&
          (S[4] == 's') && (S[5] == 'o') && (S[6] == 'r') && (S[7] == 's')) {
        cout << "M" << endl;
        return 0;
      }
    }
    if ((M[0] == 'p') && (M[1] == 'a') && (M[2] == 'p') && (M[3] == 'e') &&
        (M[4] == 'r')) {
      if ((S[0] == 'r') && (S[1] == 'o') && (S[2] == 'c') && (S[3] == 'k')) {
        cout << "?" << endl;
        return 0;
      }
    }
    if ((M[0] == 's') && (M[1] == 'c') && (M[2] == 'i') && (M[3] == 's') &&
        (M[4] == 's') && (M[5] == 'o') && (M[6] == 'r') && (M[7] == 's')) {
      if ((S[0] == 'r') && (S[1] == 'o') && (S[2] == 'c') && (S[3] == 'k')) {
        cout << "S" << endl;
        return 0;
      }
    }
    if ((M[0] == 's') && (M[1] == 'c') && (M[2] == 'i') && (M[3] == 's') &&
        (M[4] == 's') && (M[5] == 'o') && (M[6] == 'r') && (M[7] == 's')) {
      if ((S[0] == 'p') && (S[1] == 'a') && (S[2] == 'p') && (S[3] == 'e') &&
          (S[4] == 'r')) {
        cout << "?" << endl;
        return 0;
      }
    }
    if ((M[0] == 'p') && (M[1] == 'a') && (M[2] == 'p') && (M[3] == 'e') &&
        (M[4] == 'r')) {
      if ((S[0] == 's') && (S[1] == 'c') && (S[2] == 'i') && (S[3] == 's') &&
          (S[4] == 's') && (S[5] == 'o') && (S[6] == 'r') && (S[7] == 's')) {
        cout << "?" << endl;
        return 0;
      }
    }
  }
}
