#include <bits/stdc++.h>
using namespace std;
string decide(string s1, string s2) {
  if (s1 == "rock" && s2 == "paper") return "right";
  if (s1 == "rock" && s2 == "scissors") return "left";
  if (s1 == "scissors" && s2 == "rock") return "right";
  if (s1 == "scissors" && s2 == "paper") return "left";
  if (s1 == "paper" && s2 == "scissors") return "right";
  if (s1 == "paper" && s2 == "rock") return "left";
  return "equal";
}
int main() {
  int ans1 = 0, ans2 = 0, ans3 = 0;
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  if (decide(s1, s2) == "left")
    ans1 += 2;
  else if (decide(s1, s2) == "equal")
    ans1 += 1;
  if (decide(s1, s3) == "left")
    ans1 += 2;
  else if (decide(s1, s3) == "equal")
    ans1 += 1;
  if (decide(s2, s1) == "left")
    ans2 += 2;
  else if (decide(s2, s1) == "equal")
    ans2 += 1;
  if (decide(s2, s3) == "left")
    ans2 += 2;
  else if (decide(s2, s3) == "equal")
    ans2 += 1;
  if (decide(s3, s1) == "left")
    ans3 += 2;
  else if (decide(s3, s1) == "equal")
    ans3 += 1;
  if (decide(s3, s2) == "left")
    ans3 += 2;
  else if (decide(s3, s2) == "equal")
    ans3 += 1;
  if (ans1 > ans2 && ans1 > ans3)
    printf("F\n");
  else if (ans2 > ans1 && ans2 > ans3)
    printf("M\n");
  else if (ans3 > ans1 && ans3 > ans2)
    printf("S\n");
  else
    printf("?\n");
  return 0;
}
