#include <bits/stdc++.h>
using namespace std;
bool b[4][4] = {{0, 0, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}, {0, 1, 0, 0}};
int main() {
  int a[4];
  string s;
  for (int i = 1; i <= 3; i++) {
    cin >> s;
    if (s == "rock") {
      a[i] = 1;
    } else {
      a[i] = 2;
    }
    if (s == "paper") {
      a[i] = 3;
    }
  }
  if (b[a[1]][a[2]] && b[a[1]][a[3]]) {
    cout << "F";
  } else {
    if (b[a[2]][a[1]] && b[a[2]][a[3]]) {
      cout << "M";
    } else {
      if (b[a[3]][a[1]] && b[a[3]][a[2]]) {
        cout << "S";
      } else {
        cout << "?";
      }
    }
  }
  return 0;
}
