#include <bits/stdc++.h>
using namespace std;
bool isWin(string a, string b, string c) {
  if (b == c) {
    if (a == "rock" && b == "scissors")
      return true;
    else if (a == "rock" && b == "paper")
      return false;
    else if (a == "paper" && b == "scissors")
      return false;
    else if (a == "paper" && b == "rock")
      return true;
    else if (a == "scissors" && b == "rock")
      return false;
    else
      return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  string f, m, s;
  cin >> f >> m >> s;
  if (f == m && f == s && m == s)
    cout << "?";
  else if (f != m && f != s && m != s)
    cout << "?";
  else {
    if (isWin(f, m, s))
      cout << "F";
    else if (isWin(m, f, s))
      cout << "M";
    else if (isWin(s, f, m))
      cout << "S";
    else
      cout << "?";
  }
  return 0;
}
