#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[100], b[100], c[100];
  int ct[10];
  string r = "rsp";
  int i, win;
  while (scanf(" %s", &a) == 1) {
    scanf(" %s %s", &b, &c);
    memset(ct, 0, sizeof(ct));
    if (strcmp(a, "rock") == 0) ct[0]++;
    if (strcmp(a, "scissors") == 0) ct[1]++;
    if (strcmp(a, "paper") == 0) ct[2]++;
    if (strcmp(b, "rock") == 0) ct[0]++;
    if (strcmp(b, "scissors") == 0) ct[1]++;
    if (strcmp(b, "paper") == 0) ct[2]++;
    if (strcmp(c, "rock") == 0) ct[0]++;
    if (strcmp(c, "scissors") == 0) ct[1]++;
    if (strcmp(c, "paper") == 0) ct[2]++;
    win = -1;
    for (i = 0; i < 3; i++) {
      if (ct[i] == 1 && ct[(i + 1) % 3] == 2) {
        win = i;
        break;
      }
    }
    if (win == -1)
      printf("?\n");
    else {
      if (a[0] == r[win]) printf("F\n");
      if (b[0] == r[win]) printf("M\n");
      if (c[0] == r[win]) printf("S\n");
    }
  }
  return 0;
}
