#include <bits/stdc++.h>
using namespace std;
int main() {
  string f;
  string m;
  string s;
  string F = "F";
  string M = "M";
  string S = "S";
  cin >> f >> m >> s;
  if (f == "rock" && m == "scissors" && s == "scissors") {
    cout << F << endl;
    return 0;
  }
  if (m == "rock" && f == "scissors" && s == "scissors") {
    cout << M << endl;
    return 0;
  }
  if (s == "rock" && m == "scissors" && f == "scissors") {
    cout << S << endl;
    return 0;
  }
  if (f == "paper" && m == "rock" && s == "rock") {
    cout << F << endl;
    return 0;
  }
  if (m == "paper" && f == "rock" && s == "rock") {
    cout << M << endl;
    return 0;
  }
  if (s == "paper" && m == "rock" && f == "rock") {
    cout << S << endl;
    return 0;
  }
  if (f == "scissors" && m == "paper" && s == "paper") {
    cout << F << endl;
    return 0;
  }
  if (m == "scissors" && f == "paper" && s == "paper") {
    cout << M << endl;
    return 0;
  }
  if (s == "scissors" && m == "paper" && f == "paper") {
    cout << S << endl;
    return 0;
  }
  cout << "?" << endl;
  return 0;
}
