#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
template <class _T>
inline string tostr(const _T& a) {
  ostringstream os("");
  os << a;
  return os.str();
}
const long double PI = 3.1415926535897932384626433832795;
const long double EPS = 1e-9;
string s1, s2, s3;
int main() {
  cout.flags(ios::fixed);
  cout.precision(2);
  cin >> s1 >> s2 >> s3;
  if (s1[0] == 'p' && s2[0] == 'r' && s3[0] == 'r' ||
      s1[0] == 's' && s2[0] == 'p' && s3[0] == 'p' ||
      s1[0] == 'r' && s2[0] == 's' && s3[0] == 's') {
    cout << "F";
    return 0;
  }
  if (s2[0] == 'p' && s1[0] == 'r' && s3[0] == 'r' ||
      s2[0] == 's' && s1[0] == 'p' && s3[0] == 'p' ||
      s2[0] == 'r' && s1[0] == 's' && s3[0] == 's') {
    cout << "M";
    return 0;
  }
  if (s3[0] == 'p' && s2[0] == 'r' && s1[0] == 'r' ||
      s3[0] == 's' && s2[0] == 'p' && s1[0] == 'p' ||
      s3[0] == 'r' && s2[0] == 's' && s1[0] == 's') {
    cout << "S";
    return 0;
  }
  cout << "?";
  return 0;
}
