#include <bits/stdc++.h>
const long long max9 = 10 + 1e9, max6 = 10 + 1e6, max12 = 10 + 1e12,
                max15 = 10 + 1e15;
const long long min6 = -1 * max6, min9 = -1 * max9, min12 = -1 * max12,
                min15 = -1 * max15;
const long long R = 7 + 1e9, NN = 10 + 1e5;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string a[3];
  for (int i = (0); i < (3); ++i) cin >> a[i];
  string b[3][2] = {
      {"rock", "scissors"}, {"paper", "rock"}, {"scissors", "paper"}};
  string ans = "?";
  for (int i = (0); i < (3); ++i) {
    for (int j = (0); j < (3); ++j) {
      if (a[i] == b[j][1]) {
        for (int k = (0); k < (3); ++k) {
          if (a[k] == b[j][0]) {
            if (ans != "?") {
              if (k == 0 && ans == "F") continue;
              if (k == 1 && ans == "M") continue;
              if (k == 2 && ans == "S") continue;
              cout << "?";
              return 0;
            }
            if (k == 0) ans = "F";
            if (k == 1) ans = "M";
            if (k == 2) ans = "S";
          }
        }
      }
    }
  }
  cout << ans;
  return 0;
}
