#include <bits/stdc++.h>
using namespace std;
int main() {
  string noj = "scissors", bum = "paper", kam = "rock", s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  if (s1 == bum && s2 == kam && s3 == kam) {
    cout << "F";
    return 0;
  }
  if (s2 == bum && s1 == kam && s3 == kam) {
    cout << "M";
    return 0;
  }
  if (s3 == bum && s2 == kam && s1 == kam) {
    cout << "S";
    return 0;
  }
  if (s1 == noj && s2 == bum && s3 == bum) {
    cout << "F";
    return 0;
  }
  if (s2 == noj && s1 == bum && s3 == bum) {
    cout << "M";
    return 0;
  }
  if (s3 == noj && s2 == bum && s1 == bum) {
    cout << "S";
    return 0;
  }
  if (s1 == kam && s2 == noj && s3 == noj) {
    cout << "F";
    return 0;
  }
  if (s2 == kam && s1 == noj && s3 == noj) {
    cout << "M";
    return 0;
  }
  if (s3 == kam && s2 == noj && s1 == noj) {
    cout << "S";
    return 0;
  }
  cout << "?";
  return 0;
}
