#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, a, b;
  cin >> s >> a >> b;
  int s1 = s.size(), a1 = a.size(), b1 = b.size();
  if (s == a && b == a && s == b)
    cout << "?";
  else if (s != a && b != s && a != b)
    cout << "?";
  else {
    if (s1 > a1 && a1 == b1 && s1 != 8) {
      cout << "F";
      return 0;
    } else if (s1 == 8 && a1 == 5 && a1 == b1) {
      cout << "F";
      return 0;
    } else if (s1 == 4 && a1 == 8 && a1 == b1) {
      cout << "F";
      return 0;
    }
    if (a1 > s1 && s1 == b1 && a1 != 8) {
      cout << "M";
      return 0;
    } else if (a1 == 8 && s1 == 5 && s1 == b1) {
      cout << "M";
      return 0;
    } else if (a1 == 4 && s1 == 8 && s1 == b1) {
      cout << "M";
      return 0;
    } else if (b1 > a1 && a1 == s1 && b1 != 8) {
      cout << "S";
      return 0;
    } else if (b1 == 8 && a1 == 5 && a1 == s1) {
      cout << "S";
      return 0;
    } else if (b1 == 4 && a1 == 8 && a1 == s1) {
      cout << "S";
      return 0;
    }
    cout << "?";
  }
  return 0;
}
