#include <bits/stdc++.h>
using namespace std;
bool cek(string a, string b, string c) {
  if (a == "paper" && b == "rock" && c == "rock") return true;
  if (a == "scissors" && b == "paper" && c == "paper") return true;
  if (a == "rock" && b == "scissors" && c == "scissors") return true;
  return false;
}
int main() {
  vector<string> s;
  string in;
  set<string> ss;
  for (int i = 0; i < 3; i++) {
    cin >> in;
    s.push_back(in);
    ss.insert(in);
  }
  if ((ss).size() == 1 || (ss).size() == 3) {
    printf("?\n");
    return 0;
  }
  if (cek(s[0], s[1], s[2]))
    printf("F\n");
  else if (cek(s[1], s[0], s[2]))
    printf("M\n");
  else if (cek(s[2], s[0], s[1]))
    printf("S\n");
  else
    printf("?\n");
  return 0;
}
