#include <bits/stdc++.h>
using namespace std;
char a;
int main(void) {
  char a[3][10], b[3][10] = {"rock", "paper", "scissors"};
  int sos[3] = {};
  cin >> a[0] >> a[1] >> a[2];
  for (int i = 0; i < 3; i++) {
    if (strcmp(a[0], b[i]) == 0) sos[i]++;
    if (strcmp(a[1], b[i]) == 0) sos[i]++;
    if (strcmp(a[2], b[i]) == 0) sos[i]++;
  }
  int t = 0;
  for (int i = 0; i < 3; i++) {
    if (sos[i] == 1 && sos[(i + 1) % 3] == 0) {
      if (strcmp(a[0], b[i]) == 0) {
        t = 1;
        cout << "F";
      }
      if (strcmp(a[1], b[i]) == 0) {
        t = 1;
        cout << "M";
      }
      if (strcmp(a[2], b[i]) == 0) {
        t = 1;
        cout << "S";
      }
    }
  }
  if (t == 0) cout << "?";
  return 0;
}
