#include <bits/stdc++.h>
using namespace std;
bool beat(string a, string b) {
  if (a == "rock") {
    return b == "scissors";
  } else if (a == "paper") {
    return b == "rock";
  } else {
    return b == "paper";
  }
}
int main() {
  string a, b, c;
  cin >> a >> b >> c;
  if (a == b && b != c && beat(c, b)) {
    cout << "S";
  } else if (a == c && b != c and beat(b, c)) {
    cout << "M";
  } else if (b == c && c != a and beat(a, b)) {
    cout << "F";
  } else {
    cout << "?";
  }
}
