#include <bits/stdc++.h>
using namespace std;
const double EPS = 0.00000001;
const int INF = 1000000000;
int main() {
  string s[3];
  for (int i = 0; i < 3; i++) cin >> s[i];
  int h[3];
  for (int i = 0; i < 3; i++) {
    if (s[i][0] == 'r') h[i] = 0;
    if (s[i][0] == 'p') h[i] = 1;
    if (s[i][0] == 's') h[i] = 2;
  }
  for (int i = 0; i < 3; i++) {
    bool win = true;
    for (int j = 0; j < 3; j++) {
      if (i == j) continue;
      if ((h[i] + 3 - 1) % 3 != h[j]) win = false;
    }
    if (win) {
      if (i == 0) cout << "F" << endl;
      if (i == 1) cout << "M" << endl;
      if (i == 2) cout << "S" << endl;
      return 0;
    }
  }
  cout << '?' << endl;
  return 0;
}
