#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  if (s1 == s2 && s2 == s3) {
    cout << "?" << endl;
  } else if (s1 == s2 && s2 != s3) {
    if (s1 == "rock" && s3 == "paper") {
      cout << "S" << endl;
    } else if (s1 == "rock" && s3 == "scissors") {
      cout << "?" << endl;
    } else if (s1 == "paper" && s3 == "scissors") {
      cout << "S" << endl;
    } else if (s1 == "scissors" && s3 == "rock") {
      cout << "S" << endl;
    } else {
      cout << "?" << endl;
    }
  } else if (s1 == s3 && s1 != s2) {
    if (s1 == "rock" && s2 == "paper") {
      cout << "M" << endl;
    } else if (s1 == "rock" && s2 == "scissors") {
      cout << "?" << endl;
    } else if (s1 == "paper" && s2 == "scissors") {
      cout << "M" << endl;
    } else if (s1 == "scissors" && s2 == "rock") {
      cout << "M" << endl;
    } else {
      cout << "?" << endl;
    }
  } else if (s2 == s3 && s1 != s3) {
    if (s2 == "rock" && s1 == "paper") {
      cout << "F" << endl;
    } else if (s2 == "rock" && s1 == "scissors") {
      cout << "?" << endl;
    } else if (s2 == "paper" && s1 == "scissors") {
      cout << "F" << endl;
    } else if (s2 == "scissors" && s1 == "rock") {
      cout << "F" << endl;
    } else {
      cout << "?" << endl;
    }
  } else {
    cout << "?" << endl;
  }
  return 0;
}
