#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  if ((s1[0] == 'r' && s2[0] == 's' && s3[0] == 's') ||
      (s1[0] == 's' && s2[0] == 'p' && s3[0] == 'p') ||
      (s1[0] == 'p' && s2[0] == 'r' && s3[0] == 'r')) {
    cout << "F\n";
  } else if ((s2[0] == 'r' && s1[0] == 's' && s3[0] == 's') ||
             (s2[0] == 's' && s1[0] == 'p' && s3[0] == 'p') ||
             (s2[0] == 'p' && s1[0] == 'r' && s3[0] == 'r')) {
    cout << "M\n";
  } else if ((s3[0] == 'r' && s1[0] == 's' && s2[0] == 's') ||
             (s3[0] == 's' && s1[0] == 'p' && s2[0] == 'p') ||
             (s3[0] == 'p' && s1[0] == 'r' && s2[0] == 'r')) {
    cout << "S\n";
  } else {
    cout << "?\n";
  }
  return 0;
}
