#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s1, s2, s3, ans;
  map<string, int> ct;
  map<string, vector<char>> c;
  cin >> s1 >> s2 >> s3;
  ct[s1]++;
  c[s1].push_back('F');
  ct[s2]++;
  c[s2].push_back('M');
  ct[s3]++;
  c[s3].push_back('S');
  if ((ct.size() == 3) || (ct.size() == 1))
    ans = "?";
  else {
    ans = "?";
    if ((ct["paper"] == 1) && (ct["rock"] == 2)) ans = c["paper"][0];
    if ((ct["rock"] == 1) && (ct["scissors"] == 2)) ans = c["rock"][0];
    if ((ct["scissors"] == 1) && (ct["paper"] == 2)) ans = c["scissors"][0];
  }
  cout << ans << "\n";
  return 0;
}
