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