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