#include <bits/stdc++.h>
using namespace std;
int main() {
  string s[3];
  for (int i = 0; i < 3; ++i) cin >> s[i];
  int r = 0, p = 0, sc = 0;
  for (int i = 0; i < 3; ++i) {
    if (s[i] == "rock") ++r;
    if (s[i] == "paper") ++p;
    if (s[i] == "scissors") ++sc;
  }
  if (r == 2 && p == 1) {
    if (s[0] == "paper") cout << "F";
    if (s[1] == "paper") cout << "M";
    if (s[2] == "paper") cout << "S";
  } else if (sc == 2 && r == 1) {
    if (s[0] == "rock") cout << "F";
    if (s[1] == "rock") cout << "M";
    if (s[2] == "rock") cout << "S";
  } else if (p == 2 && sc == 1) {
    if (s[0] == "scissors") cout << "F";
    if (s[1] == "scissors") cout << "M";
    if (s[2] == "scissors") cout << "S";
  } else
    cout << "?";
}
