#include <bits/stdc++.h>
using namespace std;
int main() {
  set<string> st;
  string str[10];
  string str1, str2, str3;
  cin >> str1 >> str2 >> str3;
  str[0] = str1;
  str[1] = str2;
  str[2] = str3;
  st.insert(str1);
  st.insert(str2);
  st.insert(str3);
  map<string, int> m;
  int idx;
  m[str1]++;
  m[str2]++;
  m[str3]++;
  map<int, char> mep;
  mep[0] = 'F';
  mep[1] = 'M';
  mep[2] = 'S';
  mep[3] = '?';
  if (st.size() == 3) {
    idx = 3;
  } else {
    if (m["paper"] == 2) {
      if (m["scissors"] == 1) {
        for (int i = 0; i < 3; i++) {
          if (str[i] == "scissors") {
            idx = i;
            break;
          }
        }
      } else {
        idx = 3;
      }
    } else if (m["scissors"] == 2) {
      if (m["rock"] == 1) {
        for (int i = 0; i < 3; i++) {
          if (str[i] == "rock") {
            idx = i;
            break;
          }
        }
      } else {
        idx = 3;
      }
    } else if (m["rock"] == 2) {
      if (m["paper"] == 1) {
        for (int i = 0; i < 3; i++) {
          if (str[i] == "paper") {
            idx = i;
            break;
          }
        }
      } else {
        idx = 3;
      }
    } else {
      idx = 3;
    }
  }
  cout << mep[idx] << endl;
  return 0;
}
