#include <bits/stdc++.h>
using namespace std;
int max(int a, int b) {
  if (a > b)
    return a;
  else
    return b;
}
int main() {
  vector<string> ts;
  string name[3];
  name[0] = "F";
  name[1] = "M";
  name[2] = "S";
  string F, M, S;
  while (cin >> F >> M >> S) {
    ts.clear();
    ts.push_back(F);
    ts.push_back(M);
    ts.push_back(S);
    int v[3], f, m, s;
    if (find(ts.begin(), ts.end(), "rock") != ts.end()) {
      if (find(ts.begin(), ts.end(), "paper") != ts.end()) {
        if (find(ts.begin(), ts.end(), "scissors") != ts.end()) {
          cout << "?\n";
        } else {
          vector<string>::iterator t = find(ts.begin(), ts.end(), "paper");
          if (find(t + 1, ts.end(), "paper") == ts.end())
            cout << name[t - ts.begin()] << endl;
          else
            cout << "?\n";
        }
      } else {
        vector<string>::iterator t = find(ts.begin(), ts.end(), "rock");
        if (find(t + 1, ts.end(), "rock") == ts.end())
          cout << name[t - ts.begin()] << endl;
        else
          cout << "?\n";
      }
    } else {
      vector<string>::iterator t = find(ts.begin(), ts.end(), "scissors");
      if (t != ts.end())
        if (find(t + 1, ts.end(), "scissors") == ts.end())
          cout << name[t - ts.begin()] << endl;
        else
          cout << "?\n";
      else
        cout << "?\n";
    }
  }
  return 0;
}
