#include <bits/stdc++.h>
using namespace std;
char s[101][101];
char r[] = {'F', 'M', 'S'};
int main() {
  map<string, int> m;
  m["rock"] = 0;
  m["paper"] = 1;
  m["scissors"] = 2;
  while (scanf("%s", s[0]) > 0 && s[0][0]) {
    int a[3] = {0};
    a[m[string(s[0])]]++;
    int i;
    for (i = 1; i < 3; i++) {
      scanf("%s", s[i]);
      a[m[string(s[i])]]++;
    }
    for ((i) = 0; (i) < (3); (i)++) {
      if (!strcmp(s[i], "rock") && a[2] == 2) {
        printf("%c\n", r[i]);
        break;
      }
      if (!strcmp(s[i], "paper") && a[0] == 2) {
        printf("%c\n", r[i]);
        break;
      }
      if (!strcmp(s[i], "scissors") && a[1] == 2) {
        printf("%c\n", r[i]);
        break;
      }
    }
    if (i == 3) printf("?\n");
  }
  return 0;
}
