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