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