#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  ios::sync_with_stdio(0);
  solve();
  return 0;
}
bool AgreB(string& a, string& b) {
  if (a == "rock") {
    return b == "scissors";
  }
  if (a == "scissors") {
    return b == "paper";
  }
  return b == "rock";
}
void solve() {
  string a[3];
  for (int i = 0; i < 3; i++) cin >> a[i];
  string res[3] = {"F", "M", "S"};
  for (int i = 0; i < 3; i++) {
    int cnt = 0;
    for (int j = 0; j < 3; j++) {
      if (i != j) {
        if (AgreB(a[i], a[j])) cnt++;
      }
    }
    if (cnt == 2) {
      cout << res[i] << '\n';
      return;
    }
  }
  cout << "?\n";
}
