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