#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, string> km;
  km["rock"] = "scissors";
  km["scissors"] = "paper";
  km["paper"] = "rock";
  string ppp = "FMS";
  string a[5];
  for (int i = 0; i < 3; ++i) cin >> a[i];
  for (int i = 0; i < 3; ++i) {
    bool ok = true;
    for (int j = 0; j < 3; ++j) {
      if (i == j) continue;
      if (km[a[i]] != a[j]) ok = false;
    }
    if (ok) {
      cout << ppp[i];
      return 0;
    }
  }
  cout << "?";
  return 0;
}
