#include <bits/stdc++.h>
using namespace std;
int main() {
  string f, m, s;
  getline(cin, f);
  getline(cin, m);
  getline(cin, s);
  if (f == m && m == s)
    cout << "?";
  else if (f == m || m == s || f == s) {
    if (f == m) {
      if ((f == "scissors" && s == "rock") ||
          (f == "paper" && s == "scissors") || (f == "rock" && s == "paper"))
        cout << "S";
      else
        cout << "?";
    } else if (m == s) {
      if ((m == "scissors" && f == "rock") ||
          (m == "paper" && f == "scissors") || (m == "rock" && f == "paper"))
        cout << "F";
      else
        cout << "?";
    } else {
      if ((f == "scissors" && m == "rock") ||
          (f == "paper" && m == "scissors") || (f == "rock" && m == "paper"))
        cout << "M";
      else
        cout << "?";
    }
  } else
    cout << "?";
  return 0;
}
