#include <bits/stdc++.h>
using namespace std;
char p[] = {'F', 'M', 'S'};
string ad[] = {"rock", "scissors", "paper"};
int main() {
  string s;
  map<string, char> m;
  int ct[3];
  int j;
  memset(ct, 0, sizeof(ct));
  for (int i = (0); i < (3); i++) {
    cin >> s;
    for (j = 0; j < 3; j++)
      if (ad[j] == s) break;
    ct[j]++;
    m[s] = p[i];
  }
  if (m.size() != 2)
    printf("?");
  else {
    map<string, char>::iterator it = m.begin();
    map<string, char>::iterator n = it;
    for (j = 0; j < 3; j++)
      if (ad[j] == it->first) break;
    if (ct[j] == 1 && ad[(j + 1) % 3] == ((++n)->first)) {
      printf("%c\n", it->second);
    } else {
      it++;
      for (j = 0; j < 3; j++)
        if (ad[j] == it->first) break;
      n = m.begin();
      if (ct[j] == 1 && ad[(j + 1) % 3] == (n->first)) {
        printf("%c\n", it->second);
        exit(0);
      } else
        printf("?");
    }
  }
  return 0;
}
