#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, c;
  cin >> a >> b >> c;
  map<string, int> all;
  int win[4];
  all["rock"] = 1;
  all["paper"] = 2;
  all["scissors"] = 3;
  win[1] = 3;
  win[2] = 1;
  win[3] = 2;
  if (win[all[a]] == all[b] && win[all[a]] == all[c])
    cout << "F" << endl;
  else if (win[all[b]] == all[a] && win[all[b]] == all[c])
    cout << "M" << endl;
  else if (win[all[c]] == all[a] && win[all[c]] == all[b])
    cout << "S" << endl;
  else
    cout << "?" << endl;
  return 0;
}
