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