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