#include <bits/stdc++.h>
using namespace std;
int f(string s) {
  if (s == "rock")
    return 1;
  else if (s == "scissors")
    return 2;
  else
    return 3;
}
int main() {
  iostream::sync_with_stdio(false);
  string s;
  int F, M, S;
  cin >> s;
  F = f(s);
  cin >> s;
  M = f(s);
  cin >> s;
  S = f(s);
  if ((F == 1 && M == 2 && S == 2) || (F == 2 && M == 3 && S == 3) ||
      (F == 3 && M == 1 && S == 1))
    cout << 'F';
  else if ((M == 1 && F == 2 && S == 2) || (M == 2 && F == 3 && S == 3) ||
           (M == 3 && F == 1 && S == 1))
    cout << 'M';
  else if ((S == 1 && M == 2 && F == 2) || (S == 2 && M == 3 && F == 3) ||
           (S == 3 && M == 1 && F == 1))
    cout << 'S';
  else
    cout << '?';
  return 0;
}
