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