#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> m;
  m["paper"] = 0;
  m["rock"] = 1;
  m["scissors"] = 2;
  map<string, string> ans;
  string win[3][3][3] = {
      {{"", "", "scissors"}, {"", "paper", ""}, {"scissors", "", ""}},
      {{"", "paper", ""}, {"paper", "", ""}, {"", "", "rock"}},
      {{"scissors", "", ""}, {"", "", "rock"}, {"", "rock", ""}}};
  string a, b, c;
  cin >> a >> b >> c;
  if (win[m[a]][m[b]][m[c]].size() != 0) {
    if (a == win[m[a]][m[b]][m[c]]) {
      cout << "F";
    } else if (b == win[m[a]][m[b]][m[c]]) {
      cout << "M";
    } else {
      cout << "S";
    }
  } else {
    cout << "?";
  }
}
