#include <bits/stdc++.h>
using namespace std;
int check(string a, string b, string c) {
  if (a == "rock" and b == "scissors" and c == "scissors") {
    return 1;
  } else if (a == "scissors" and b == "paper" and c == "paper") {
    return 1;
  } else if (a == "paper" and b == "rock" and c == "rock") {
    return 1;
  } else {
    return 0;
  }
}
int main() {
  string game[3];
  cin >> game[0] >> game[1] >> game[2];
  int gam[3];
  gam[0] = check(game[0], game[1], game[2]);
  gam[1] = check(game[1], game[2], game[0]);
  gam[2] = check(game[2], game[0], game[1]);
  if (gam[0] == 1) {
    cout << "F" << endl;
  } else if (gam[1] == 1) {
    cout << "M" << endl;
  } else if (gam[2] == 1) {
    cout << "S" << endl;
  } else {
    cout << "?" << endl;
  }
  return 0;
}
