#include <bits/stdc++.h>
int main() {
  char ch1[10], ch2[10], ch3[10];
  scanf("%s", ch1);
  scanf("%s", ch2);
  scanf("%s", ch3);
  if (ch1[0] == 'r') {
    if (ch2[0] == 's' && ch3[0] == 's')
      printf("F\n");
    else {
      if (ch2[0] == 'p' && ch3[0] == 'r')
        printf("M\n");
      else {
        if (ch2[0] == 'r' && ch3[0] == 'p')
          printf("S\n");
        else
          printf("?\n");
      }
    }
  } else {
    if (ch1[0] == 'p') {
      if (ch2[0] == 'r' && ch3[0] == 'r')
        printf("F\n");
      else {
        if (ch2[0] == 's' && ch3[0] == 'p')
          printf("M\n");
        else {
          if (ch2[0] == 'p' && ch3[0] == 's')
            printf("S\n");
          else
            printf("?\n");
        }
      }
    } else {
      if (ch2[0] == 'p' && ch3[0] == 'p')
        printf("F\n");
      else {
        if (ch2[0] == 'r' && ch3[0] == 's')
          printf("M\n");
        else {
          if (ch2[0] == 's' && ch3[0] == 'r')
            printf("S\n");
          else
            printf("?\n");
        }
      }
    }
  }
  return 0;
}
