#include <bits/stdc++.h>
int main() {
  char a[3][9] = {"scissors", "rock", "paper"};
  char b[3][9];
  int i, l = 0, m = 0, n = 0, j, k, p;
  for (i = 0; i < 3; i++) {
    scanf("%s", b[i]);
    if (strcmp(b[i], a[0]) == 0) {
      l++;
      j = i;
    } else if (strcmp(b[i], a[1]) == 0) {
      m++;
      k = i;
    } else {
      n++;
      p = i;
    }
  }
  if (l == 1 && n == 2) {
    if (j == 0)
      printf("F");
    else if (j == 1)
      printf("M");
    else
      printf("S");
  } else if (m == 1 && l == 2) {
    if (k == 0)
      printf("F");
    else if (k == 1)
      printf("M");
    else
      printf("S");
  } else if (n == 1 && m == 2) {
    if (p == 0)
      printf("F");
    else if (p == 1)
      printf("M");
    else
      printf("S");
  } else
    printf("?");
  return (0);
}
