#include <bits/stdc++.h>
using namespace std;
map<string, int> m, w, ans;
string s[3], win[3] = {"F", "M", "S"};
set<string> v;
int main() {
  m["rock"] = 0;
  m["scissors"] = 1;
  m["paper"] = 2;
  for (int i = 0; i < 3; i++) {
    cin >> s[i];
    if (i == 0)
      ans["F"] = m[s[i]];
    else if (i == 1)
      ans["M"] = m[s[i]];
    else
      ans["S"] = m[s[i]];
  }
  for (int i = 0; i < 3; i++) {
    for (int j = i; j < 3; j++) {
      if ((ans[win[i]] + 1) % 3 == ans[win[j]]) v.insert(win[i]);
      if ((ans[win[j]] + 1) % 3 == ans[win[i]]) v.insert(win[j]);
    }
  }
  if (v.size() == 1)
    cout << *v.begin();
  else
    cout << "?";
  return 0;
}
