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