#include <bits/stdc++.h>
using namespace std;
bool bit(string a, string b, string c) {
  return ((a == "rock" && b == "scissors" && c == "scissors") ||
          (a == "scissors" && b == "paper" && c == "paper") ||
          (a == "paper" && b == "rock" && c == "rock"));
}
int main() {
  string a, b, c;
  cin >> a >> b >> c;
  if (bit(a, b, c))
    cout << "F";
  else if (bit(b, a, c))
    cout << "M";
  else if (bit(c, b, a))
    cout << "S";
  else
    cout << "?";
}
