#include <bits/stdc++.h>
int main() {
  char f[10], m[10], s[10];
  int flag = 0;
  scanf("%s%s%s", f, m, s);
  if (strcmp(f, m) == 0) {
    if ((strcmp(s, "scissors") == 0 && strcmp(f, "paper") == 0) ||
        (strcmp(s, "paper") == 0 && strcmp(f, "rock") == 0) ||
        (strcmp(s, "rock") == 0 && strcmp(f, "scissors") == 0)) {
      printf("S");
      flag = 1;
    }
  }
  if (strcmp(f, s) == 0) {
    if ((strcmp(m, "scissors") == 0 && strcmp(f, "paper") == 0) ||
        (strcmp(m, "paper") == 0 && strcmp(f, "rock") == 0) ||
        (strcmp(m, "rock") == 0 && strcmp(f, "scissors") == 0)) {
      printf("M");
      flag = 1;
    }
  }
  if (strcmp(s, m) == 0) {
    if ((strcmp(f, "scissors") == 0 && strcmp(s, "paper") == 0) ||
        (strcmp(f, "paper") == 0 && strcmp(s, "rock") == 0) ||
        (strcmp(f, "rock") == 0 && strcmp(s, "scissors") == 0)) {
      printf("F");
      flag = 1;
    }
  }
  if (!flag) {
    printf("?");
  }
  return 0;
}
