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