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