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