#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-5;
bool win(char x, char y) {
  if (x == 'r' && y == 's') return true;
  if (x == 'p' && y == 'r') return true;
  if (x == 's' && y == 'p') return true;
  return false;
}
int winner(const char* hands) {
  for (int i = 0; i != 3; ++i) {
    bool win_all(true);
    for (int j = 0; j != 3; ++j) {
      if (i == j) continue;
      win_all = win_all && win(hands[i], hands[j]);
    }
    if (win_all) return i;
  }
  return 3;
}
int main(int argc, char* argv[]) {
  char hands[3];
  for (int i = 0; i != 3; ++i) {
    string l;
    cin >> l;
    hands[i] = l[0];
  }
  const char players[4] = {'F', 'M', 'S', '?'};
  cout << players[winner(hands)] << endl;
  return 0;
}
