#include <bits/stdc++.h>
using namespace std;
char c, d;
string t = "aeiouyAEIOUY";
int main() {
  string s, t, u;
  cin >> s >> t >> u;
  if ((s[0] == 'r' and t[0] == 's' and u[0] == 's') or
      (s[0] == 's' and t[0] == 'p' and u[0] == 'p') or
      (s[0] == 'p' and t[0] == 'r' and u[0] == 'r'))
    cout << 'F' << endl;
  else if ((s[0] == 's' and t[0] == 'r' and u[0] == 's') or
           (s[0] == 'p' and t[0] == 's' and u[0] == 'p') or
           (s[0] == 'r' and t[0] == 'p' and u[0] == 'r'))
    cout << 'M' << endl;
  else if ((s[0] == 's' and t[0] == 's' and u[0] == 'r') or
           (s[0] == 'r' and t[0] == 'r' and u[0] == 'p') or
           (s[0] == 'p' and t[0] == 'p' and u[0] == 's'))
    cout << 'S' << endl;
  else
    cout << '?' << endl;
}
