#include <bits/stdc++.h>
using namespace std;
int main() {
  int correct[10] = {133, 313, 331, 211, 121, 112, 322, 232, 223};
  char S1[20], S2[20], S3[20], str[100];
  int num;
  cin >> S1;
  if (!strcmp(S1, "rock"))
    num = 1;
  else if (!strcmp(S1, "paper"))
    num = 2;
  else if (!strcmp(S1, "scissors"))
    num = 3;
  cin.getline(str, 100);
  cin >> S2;
  if (!strcmp(S2, "rock"))
    num = num * 10 + 1;
  else if (!strcmp(S2, "paper"))
    num = num * 10 + 2;
  else if (!strcmp(S2, "scissors"))
    num = num * 10 + 3;
  cin.getline(str, 100);
  cin >> S3;
  if (!strcmp(S3, "rock"))
    num = num * 10 + 1;
  else if (!strcmp(S3, "paper"))
    num = num * 10 + 2;
  else if (!strcmp(S3, "scissors"))
    num = num * 10 + 3;
  cin.getline(str, 100);
  bool flag = true;
  for (int i = 0; i < 9; i++)
    if (num == correct[i]) {
      flag = false;
      if (i < 3) {
        if (num == 133) cout << "F" << endl;
        if (num == 313) cout << "M" << endl;
        if (num == 331) cout << "S" << endl;
      } else if (i >= 3 && i < 6) {
        if (num == 211) cout << "F" << endl;
        if (num == 121) cout << "M" << endl;
        if (num == 112) cout << "S" << endl;
      } else if (i >= 6) {
        if (num == 322) cout << "F" << endl;
        if (num == 232) cout << "M" << endl;
        if (num == 223) cout << "S" << endl;
      }
      break;
    }
  if (flag) cout << "?" << endl;
  return 0;
}
