#include <bits/stdc++.h>
using namespace std;
string fed, mat, sha;
int main() {
  cin >> fed >> mat >> sha;
  if (fed == "rock" && mat == "scissors" && sha == "scissors")
    printf("F");
  else if (fed == "scissors" && mat == "paper" && sha == "paper")
    printf("F");
  else if (fed == "paper" && mat == "rock" && sha == "rock")
    printf("F");
  else if (mat == "rock" && fed == "scissors" && sha == "scissors")
    printf("M");
  else if (mat == "scissors" && fed == "paper" && sha == "paper")
    printf("M");
  else if (mat == "paper" && fed == "rock" && sha == "rock")
    printf("M");
  else if (sha == "rock" && mat == "scissors" && fed == "scissors")
    printf("S");
  else if (sha == "scissors" && mat == "paper" && fed == "paper")
    printf("S");
  else if (sha == "paper" && mat == "rock" && fed == "rock")
    printf("S");
  else
    printf("?\n");
  return 0;
}
