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