#include <bits/stdc++.h>
int battle(std::string player1, std::string player2) {
  if (player1 == player2) {
    return 0;
  }
  if (player1 == "rock") {
    if (player2 == "scissors") {
      return 1;
    } else {
      return -1;
    }
  }
  if (player1 == "paper") {
    if (player2 == "rock") {
      return 1;
    } else {
      return -1;
    }
  }
  if (player1 == "scissors") {
    if (player2 == "paper") {
      return 1;
    } else {
      return -1;
    }
  }
}
int main(int argc, char const *argv[]) {
  std::string fyodor, matroskin, sharic;
  std::cin >> fyodor >> matroskin >> sharic;
  std::string winner = "?";
  if (battle(fyodor, matroskin) == 1) {
    if (battle(fyodor, sharic) == 1) {
      winner = "F";
    }
  } else if (battle(fyodor, matroskin) == -1) {
    if (battle(matroskin, sharic) == 1) {
      winner = "M";
    }
  } else {
    if (battle(sharic, fyodor) == 1) {
      winner = "S";
    }
  }
  std::cout << winner << '\n';
  return 0;
}
