#include <bits/stdc++.h>
using namespace std;
inline int Find(string x) {
  if (x == "rock") return 1;
  if (x == "scissors") return 2;
  if (x == "paper") return 3;
}
int main() {
  string a, b, c;
  int sa, sb, sc;
  cin >> a >> b >> c;
  sa = Find(a), sb = Find(b), sc = Find(c);
  if (sa == 1 && sb == 2 && sc == 2)
    printf("F");
  else if (sa == 2 && sb == 3 && sc == 3)
    printf("F");
  else if (sa == 3 && sb == 1 && sc == 1)
    printf("F");
  else if (sa == 2 && sb == 1 && sc == 2)
    printf("M");
  else if (sa == 3 && sb == 2 && sc == 3)
    printf("M");
  else if (sa == 1 && sb == 3 && sc == 1)
    printf("M");
  else if (sa == 2 && sb == 2 && sc == 1)
    printf("S");
  else if (sa == 3 && sb == 3 && sc == 2)
    printf("S");
  else if (sa == 1 && sb == 1 && sc == 3)
    printf("S");
  else
    printf("?");
  return 0;
}
