#include <bits/stdc++.h>
using namespace std;
const long long N = 2e3 + 7;
long long a[N], b[N], c[N];
long long n, k1, k2, cnt1, cnt2, ans, ind = 1;
string s1, s2, s3, s;
int main() {
  cin >> s1 >> s2 >> s3;
  s += s1[0];
  s += s2[0];
  s += s3[0];
  if (s == "prr" || s == "rss" || s == "spp") {
    cout << "F";
    return 0;
  }
  if (s == "rpr" || s == "srs" || s == "psp") {
    cout << "M";
    return 0;
  }
  if (s == "rrp" || s == "ssr" || s == "pps") {
    cout << "S";
    return 0;
  }
  cout << "?";
}
