#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll mod = 1e9 + 7;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string F, M, S;
  cin >> F >> M >> S;
  if ((F[0] == 'p' && M[0] == 'r' && S[0] == 'r') ||
      (F[0] == 'r' && M[0] == 's' && S[0] == 's') ||
      (F[0] == 's' && M[0] == 'p' && S[0] == 'p')) {
    cout << "F" << '\n';
  } else if ((M[0] == 'p' && F[0] == 'r' && S[0] == 'r') ||
             (M[0] == 'r' && F[0] == 's' && S[0] == 's') ||
             (M[0] == 's' && F[0] == 'p' && S[0] == 'p')) {
    cout << "M" << '\n';
  } else if ((S[0] == 'p' && M[0] == 'r' && F[0] == 'r') ||
             (S[0] == 'r' && M[0] == 's' && F[0] == 's') ||
             (S[0] == 's' && M[0] == 'p' && F[0] == 'p')) {
    cout << "S" << '\n';
  } else {
    cout << "?" << '\n';
  }
}
