#include <bits/stdc++.h>
using namespace std;
int solve(string f, string m, string s) {
  if (f[0] == 'r') {
    if (m[0] == 's' && s[0] == 's') return 1;
  }
  if (f[0] == 'p') {
    if (m[0] == 'r' && s[0] == 'r') return 1;
  }
  if (f[0] == 's') {
    if (m[0] == 'p' && s[0] == 'p') return 1;
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string f, m, s;
  cin >> f >> m >> s;
  if (solve(f, m, s))
    cout << "F";
  else if (solve(m, f, s))
    cout << "M";
  else if (solve(s, f, m))
    cout << "S";
  else
    cout << "?";
}
