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