#include <bits/stdc++.h>
using namespace std;
int main() {
  string F, M, S;
  int r = 0, p = 0, s = 0;
  cin >> F >> M >> S;
  if (F[0] == 'p')
    p++;
  else if (F[0] == 'r')
    r++;
  else if (F[0] == 's')
    s++;
  if (M[0] == 'p')
    p++;
  else if (M[0] == 'r')
    r++;
  else if (M[0] == 's')
    s++;
  if (S[0] == 'p')
    p++;
  else if (S[0] == 'r')
    r++;
  else if (S[0] == 's')
    s++;
  if ((s == 2 && p == 1) || (p == 2 && r == 1) || (r == 2 && s == 1) ||
      (s == 1 && p == 1 && r == 1) || r == 3 || s == 3 || p == 3 ||
      (r == 1 && s == 1 && p == 1))
    cout << "?";
  else {
    if ((F == "scissors" && s == 1 && p == 2) ||
        (F == "rock" && r == 1 && s == 2) || (F == "paper" && p == 1 && r == 2))
      cout << "F";
    else if ((M == "scissors" && s == 1 && p == 2) ||
             (M == "rock" && r == 1 && s == 2) ||
             (M == "paper" && p == 1 && r == 2))
      cout << "M";
    else if ((S == "scissors" && s == 1 && p == 2) ||
             (S == "rock" && r == 1 && s == 2) ||
             (S == "paper" && p == 1 && r == 2))
      cout << "S";
  }
  return 0;
}
