#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, c;
  cin >> a >> b >> c;
  if ((a == "paper" && b == "rock" && c == "rock") ||
      (a == "scissors" && b == "paper" && c == "paper") ||
      (a == "rock" && b == "scissors" && c == "scissors"))
    cout << "F";
  else if ((b == "paper" && c == "rock" && a == "rock") ||
           (b == "scissors" && c == "paper" && a == "paper") ||
           (b == "rock" && c == "scissors" && a == "scissors"))
    cout << "M";
  else if ((c == "paper" && b == "rock" && a == "rock") ||
           (c == "scissors" && b == "paper" && a == "paper") ||
           (c == "rock" && b == "scissors" && a == "scissors"))
    cout << "S";
  else
    cout << "?";
}
