#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const char nl = '\n';
const double pi = 2 * acos(0.0);
int check(string s1, string s2, string s3) {
  if (s1 == "paper" && s2 == s3 && s2 == "rock")
    return 1;
  else if (s1 == "scissors" && s2 == s3 && s2 == "paper")
    return 1;
  else if (s1 == "rock" && s2 == s3 && s3 == "scissors")
    return 1;
  else
    return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  if (check(s1, s2, s3))
    cout << "F";
  else if (check(s2, s1, s3))
    cout << "M";
  else if (check(s3, s1, s2))
    cout << "S";
  else
    cout << "?";
  return 0;
}
