#include <bits/stdc++.h>
int main() {
  int a, b, c, d;
  char n[11], m[11], l[11];
  while (~scanf("%s%s%s", n, m, l)) {
    if (n[0] == 'p' && m[0] == 'r' && l[0] == 'r')
      printf("F\n");
    else if (n[0] == 's' && m[0] == 'p' && l[0] == 'p')
      printf("F\n");
    else if (n[0] == 'r' && m[0] == 's' && l[0] == 's')
      printf("F\n");
    else if (m[0] == 'p' && n[0] == 'r' && l[0] == 'r')
      printf("M\n");
    else if (m[0] == 's' && n[0] == 'p' && l[0] == 'p')
      printf("M\n");
    else if (m[0] == 'r' && n[0] == 's' && l[0] == 's')
      printf("M\n");
    else if (l[0] == 'p' && m[0] == 'r' && n[0] == 'r')
      printf("S\n");
    else if (l[0] == 's' && m[0] == 'p' && n[0] == 'p')
      printf("S\n");
    else if (l[0] == 'r' && m[0] == 's' && n[0] == 's')
      printf("S\n");
    else
      printf("?\n");
  }
}
