#include <bits/stdc++.h>
using namespace std;
int main() {
  string F, M, S;
  cin >> F >> M >> S;
  auto win = [](string a, string b, string c) -> int {
    if (a == "rock" && b == "scissors" && c == "scissors") return 1;
    if (a == "paper" && b == "rock" && c == "rock") return 1;
    if (a == "scissors" && b == "paper" && c == "paper") return 1;
    return 0;
  };
  if (win(F, M, S)) {
    cout << "F";
    return 0;
  }
  if (win(M, F, S)) {
    cout << "M";
    return 0;
  }
  if (win(S, F, M)) {
    cout << "S";
    return 0;
  }
  cout << "?";
  return 0;
}
