#include <bits/stdc++.h>
using namespace std;
bool cmp(string a, string b) {
  if (a == "rock" and b == "scissors") return true;
  if (a == "scissors" and b == "paper") return true;
  if (a == "paper" and b == "rock")
    return true;
  else
    return false;
}
int main() {
  int n;
  string sF, sM, sS;
  getline(cin, sF);
  getline(cin, sM);
  getline(cin, sS);
  if (sF == sM and sM == sS)
    puts("?");
  else {
    if (cmp(sF, sM) == true and cmp(sF, sS) == true)
      puts("F");
    else if (cmp(sM, sF) == true and cmp(sM, sS) == true)
      puts("M");
    else if (cmp(sS, sF) == true and cmp(sS, sM) == true)
      puts("S");
    else
      puts("?");
  }
  return 0;
}
