#include <bits/stdc++.h>
using namespace std;
int main() {
  std::string a[3], s;
  for (int i = 0; i < 3; i++) {
    std::cin >> a[i];
    s += a[i][0];
  }
  if (s == "prr" || s == "rss" || s == "spp") {
    cout << "F";
  } else if (s == "rpr" || s == "srs" || s == "psp") {
    cout << "M";
  } else if (s == "rrp" || s == "ssr" || s == "pps") {
    cout << "S";
  } else {
    cout << "?";
  }
  return 0;
}
