#include <bits/stdc++.h>
using namespace std;
int main() {
  string f, m, s;
  cin >> f >> m >> s;
  if ((f[0] == 'r' && m[0] == 's' && s[0] == 's') ||
      (f[0] == 's' && m[0] == 'p' && s[0] == 'p') ||
      (f[0] == 'p' && m[0] == 'r' && s[0] == 'r'))
    cout << "F";
  else if ((f[0] == 's' && m[0] == 'r' && s[0] == 's') ||
           (f[0] == 'p' && m[0] == 's' && s[0] == 'p') ||
           (f[0] == 'r' && m[0] == 'p' && s[0] == 'r'))
    cout << "M";
  else if ((f[0] == 's' && m[0] == 's' && s[0] == 'r') ||
           (f[0] == 'p' && m[0] == 'p' && s[0] == 's') ||
           (f[0] == 'r' && m[0] == 'r' && s[0] == 'p'))
    cout << "S";
  else
    cout << "?";
}
