#include <bits/stdc++.h>
using namespace std;
struct sign {
  string value;
};
bool operator<(const sign& lhs, const sign& rhs) {
  if (lhs.value == "rock" && rhs.value == "paper") {
    return true;
  } else if (lhs.value == "rock" && rhs.value == "scissors") {
    return false;
  } else if (lhs.value == "paper" && rhs.value == "scissors") {
    return true;
  } else if (lhs.value == "paper" && rhs.value == "rock") {
    return false;
  } else if (lhs.value == "scissors" && rhs.value == "rock") {
    return true;
  } else if (lhs.value == "scissors" && rhs.value == "paper") {
    return false;
  } else {
    return false;
  }
}
int main() {
  sign f, m, s;
  cin >> f.value >> m.value >> s.value;
  if (m < f && s < f) {
    cout << "F";
  } else if (f < m && s < m) {
    cout << "M";
  } else if (f < s && m < s) {
    cout << "S";
  } else {
    cout << "?";
  }
  return 0;
}
