#include <bits/stdc++.h>
int main() {
  char ch, ch1, ch2, ch3;
  ch1 = std::getchar();
  while ((ch = std::getchar()) != '\n')
    ;
  ch2 = std::getchar();
  while ((ch = std::getchar()) != '\n')
    ;
  ch3 = std::getchar();
  if (ch1 == 'r') {
    if (ch2 == 's' && ch2 == ch3)
      std::putchar('F');
    else if (ch3 == 'p' && ch1 == ch2)
      std::putchar('S');
    else if (ch2 == 'p' && ch1 == ch3)
      std::putchar('M');
    else
      std::putchar('?');
  } else if (ch1 == 's') {
    if (ch2 == 'p' && ch2 == ch3)
      std::putchar('F');
    else if (ch3 == 'r' && ch1 == ch2)
      std::putchar('S');
    else if (ch2 == 'r' && ch1 == ch3)
      std::putchar('M');
    else
      std::putchar('?');
  } else {
    if (ch2 == 'r' && ch2 == ch3)
      std::putchar('F');
    else if (ch3 == 's' && ch1 == ch2)
      std::putchar('S');
    else if (ch2 == 's' && ch1 == ch3)
      std::putchar('M');
    else
      std::putchar('?');
  }
}
