#include <bits/stdc++.h>
using namespace std;
template <typename T>
string tostr(const T& t) {
  ostringstream os;
  os << t;
  return os.str();
}
long long big = 2000000000010LL;
bool winner(string& a, string& b, string& c) {
  if (a == "rock" && b == "scissors" && c == "scissors") return true;
  if (a == "paper" && b == "rock" && c == "rock") return true;
  if (a == "scissors" && b == "paper" && c == "paper") return true;
  return false;
}
int main() {
  string f, m, s;
  cin >> f >> m >> s;
  if (winner(f, m, s))
    cout << "F" << endl;
  else if (winner(m, f, s))
    cout << "M" << endl;
  else if (winner(s, f, m))
    cout << "S" << endl;
  else
    cout << "?" << endl;
  return 0;
}
