#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const int INF = 1 << 28;
const long long INFL = 1LL << 62;
int Taxi[4] = {0};
int game(string s1, string s2) {
  if (s1 == s2) return 0;
  if (s1 == "paper") {
    if (s2 == "rock")
      return 1;
    else
      return 2;
  } else if (s1 == "scissors") {
    if (s2 == "paper")
      return 1;
    else
      return 2;
  } else {
    if (s2 == "scissors")
      return 1;
    else
      return 2;
  }
}
int main() {
  string f, m, s;
  char ans = '?';
  cin >> f >> m >> s;
  if (game(f, m) == 1) {
    if (game(f, s) == 1)
      ans = 'F';
    else if (game(f, s) == 2) {
      if (game(s, m) == 1) ans = 'S';
    }
  } else if (game(f, m) == 2) {
    if (game(m, s) == 1)
      ans = 'M';
    else if (game(m, s) == 2) {
      if (game(s, f) == 1) ans = 'S';
    }
  }
  if (game(f, s) == 1) {
    if (game(f, m) == 1)
      ans = 'F';
    else if (game(f, m) == 2) {
      if (game(s, m) == 2) ans = 'M';
    }
  } else if (game(f, s) == 2) {
    if (game(m, s) == 2)
      ans = 'S';
    else if (game(m, s) == 1) {
      if (game(m, f) == 1) ans = 'M';
    }
  }
  if (game(s, m) == 1) {
    if (game(s, f) == 1)
      ans = 'S';
    else if (game(s, f) == 2) {
      if (game(f, m) == 1) ans = 'F';
    }
  } else if (game(s, m) == 2) {
    if (game(m, f) == 1)
      ans = 'M';
    else if (game(m, f) == 2) {
      if (game(s, f) == 2) ans = 'F';
    }
  }
  cout << ans << endl;
}
