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