#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2, s3, a = "scissors", b = "paper", c = "rock";
  cin >> s1 >> s2 >> s3;
  if (((s1 == a) && (s2 == b) && (s3 == b)) ||
      ((s1 == c) && (s2 == a) && (s3 == a)) ||
      ((s1 == b) && (s2 == c) && (s3 == c))) {
    cout << "F" << endl;
  } else if (((s2 == a) && (s1 == b) && (s3 == b)) ||
             ((s2 == c) && (s1 == a) && (s3 == a)) ||
             ((s2 == b) && (s1 == c) && (s3 == c))) {
    cout << "M" << endl;
  } else if (((s3 == a) && (s1 == b) && (s2 == b)) ||
             ((s3 == c) && (s1 == a) && (s2 == a)) ||
             ((s3 == b) && (s1 == c) && (s2 == c))) {
    cout << "S" << endl;
  } else
    cout << "?" << endl;
  return 0;
}
