#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, s1, s2;
  cin >> s >> s1 >> s2;
  if (s == "scissors" && s1 == "paper" && s2 == "paper") {
    cout << "F";
    exit(0);
  }
  if (s == "rock" && s1 == "scissors" && s2 == "scissors") {
    cout << "F";
    exit(0);
  }
  if (s == "paper" && s1 == "rock" && s2 == "rock") {
    cout << "F";
    exit(0);
  }
  if (s1 == "scissors" && s2 == "paper" && s == "paper") {
    cout << "M";
    exit(0);
  }
  if (s1 == "rock" && s2 == "scissors" && s == "scissors") {
    cout << "M";
    exit(0);
  }
  if (s1 == "paper" && s2 == "rock" && s == "rock") {
    cout << "M";
    exit(0);
  }
  if (s2 == "scissors" && s1 == "paper" && s == "paper") {
    cout << "S";
    exit(0);
  }
  if (s2 == "rock" && s1 == "scissors" && s == "scissors") {
    cout << "S";
    exit(0);
  }
  if (s2 == "paper" && s1 == "rock" && s == "rock") {
    cout << "S";
    exit(0);
  }
  cout << "?";
}
