#include <bits/stdc++.h>
using namespace std;
bool victory(string, string);
int main() {
  string f, m, s;
  cin >> f >> m >> s;
  if ((f == m && m == s && f == s) || (f != m && m != s && f != s))
    printf("?");
  else if (f == m) {
    if (victory(f, s))
      printf("S");
    else
      printf("?");
  } else if (f == s) {
    if (victory(f, m))
      printf("M");
    else
      printf("?");
  } else if (s == m) {
    if (victory(s, f))
      printf("F");
    else
      printf("?");
  }
  return 0;
}
bool victory(string a, string b) {
  if ((a == "rock" && b == "paper") || (a == "paper" && b == "scissors") ||
      (a == "scissors" && b == "rock"))
    return 1;
  else
    return 0;
}
