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