#include <bits/stdc++.h>
using namespace std;
bool larger(string a, string b) {
  if (a == "rock" && b == "scissors") {
    return 1;
  }
  if (a == "scissors" && b == "paper") {
    return 1;
  }
  if (a == "paper" && b == "rock") {
    return 1;
  }
  return 0;
}
string solve() {
  string a, b, c;
  cin >> a >> b >> c;
  set<string> st;
  st.insert(a);
  st.insert(b);
  st.insert(c);
  if (st.size() != 2) {
    return "?";
  };
  if (larger(a, b) && larger(a, c)) {
    return "F";
  }
  if (larger(b, a) && larger(b, c)) {
    return "M";
  }
  if (larger(c, b) && larger(c, a)) {
    return "S";
  }
  return "?";
}
int main() {
  cout << solve() << endl;
  return 0;
}
