#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> f;
  f["rock"] = 0;
  f["paper"] = 1;
  f["scissors"] = 2;
  int hand[3];
  for (int i = 0; i < 3; i++) {
    string s;
    cin >> s;
    hand[i] = f[s];
  }
  if ((hand[0] == 0 && hand[1] == 2 && hand[2] == 2) ||
      (hand[0] == 1 && hand[1] == 0 && hand[2] == 0) ||
      (hand[0] == 2 && hand[1] == 1 && hand[2] == 1))
    cout << 'F' << endl;
  else if ((hand[1] == 0 && hand[2] == 2 && hand[0] == 2) ||
           (hand[1] == 1 && hand[2] == 0 && hand[0] == 0) ||
           (hand[1] == 2 && hand[2] == 1 && hand[0] == 1))
    cout << 'M' << endl;
  else if ((hand[2] == 0 && hand[0] == 2 && hand[1] == 2) ||
           (hand[2] == 1 && hand[0] == 0 && hand[1] == 0) ||
           (hand[2] == 2 && hand[0] == 1 && hand[1] == 1))
    cout << 'S' << endl;
  else
    cout << '?' << endl;
  return 0;
}
