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