#include <bits/stdc++.h>
char check_win(int F, int M, int S) {
  if (F == 2 && M == 1 && S == 1) return 'F';
  if (F == 3 && M == 2 && S == 2) return 'F';
  if (F == 1 && M == 3 && S == 3) return 'F';
  if (M == 2 && F == 1 && S == 1) return 'M';
  if (M == 3 && F == 2 && S == 2) return 'M';
  if (M == 1 && F == 3 && S == 3) return 'M';
  if (S == 2 && M == 1 && F == 1) return 'S';
  if (S == 3 && M == 2 && F == 2) return 'S';
  if (S == 1 && M == 3 && F == 3) return 'S';
  return '\?';
}
using namespace std;
int main(void) {
  int arr[3];
  int M, F, S;
  char str1[10], str2[10], str3[10];
  while (cin >> str1 >> str2 >> str3) {
    if (str1[0] == 'r')
      F = 1;
    else if (str1[0] == 's')
      F = 3;
    else
      F = 2;
    if (str2[0] == 'r')
      M = 1;
    else if (str2[0] == 's')
      M = 3;
    else
      M = 2;
    if (str3[0] == 'r')
      S = 1;
    else if (str3[0] == 's')
      S = 3;
    else
      S = 2;
    char result = check_win(F, M, S);
    cout << result << endl;
  }
  return 0;
}
