#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[9], b[9], c[9];
  int x, y, z;
  cin >> a >> b >> c;
  x = strlen(a);
  y = strlen(b);
  z = strlen(c);
  if ((x == y && y == 4 && z == 5) || (x == y && y == 5 && z == 8) ||
      (x == y && y == 8 && z == 4))
    printf("S");
  else if ((x == z && z == 4 && y == 5) || (x == z && z == 5 && y == 8) ||
           (x == z && z == 8 && y == 4))
    printf("M");
  else if ((y == z && z == 4 && x == 5) || (y == z && z == 5 && x == 8) ||
           (y == z && z == 8 && x == 4))
    printf("F");
  else
    printf("?");
  return 0;
}
