#include <bits/stdc++.h>
using namespace std;
int main() {
  string a[4];
  while (cin >> a[0] >> a[1] >> a[2]) {
    if ((a[2] == "rock" && a[0] == "scissors" && a[1] == "scissors") ||
        (a[2] == "scissors" && a[0] == "paper" && a[1] == "paper") ||
        (a[2] == "paper" && a[0] == "rock" && a[1] == "rock"))
      cout << "S" << endl;
    else if ((a[0] == "rock" && a[2] == "scissors" && a[1] == "scissors") ||
             (a[0] == "scissors" && a[2] == "paper" && a[1] == "paper") ||
             (a[0] == "paper" && a[2] == "rock" && a[1] == "rock"))
      cout << "F" << endl;
    else if ((a[1] == "rock" && a[0] == "scissors" && a[2] == "scissors") ||
             (a[1] == "scissors" && a[0] == "paper" && a[2] == "paper") ||
             (a[1] == "paper" && a[0] == "rock" && a[2] == "rock"))
      cout << "M" << endl;
    else
      cout << "?" << endl;
  }
  return 0;
}
