#include <bits/stdc++.h>
using namespace std;
int main() {
  char o[3][10], name[3][2] = {"F", "M", "S"};
  int i, count[3] = {0};
  for (i = 0; i < 3; i++) {
    cin >> o[i];
    if (strcmp(o[i], "rock") == 0)
      count[0]++;
    else if (strcmp(o[i], "paper") == 0)
      count[1]++;
    else
      count[2]++;
  }
  if (count[0] == 2 && count[1] == 1) {
    for (i = 0; i < 3; i++)
      if (strcmp(o[i], "paper") == 0) {
        cout << name[i];
        break;
      }
  } else if (count[1] == 2 && count[2] == 1) {
    for (i = 0; i < 3; i++)
      if (strcmp(o[i], "scissors") == 0) {
        cout << name[i];
        break;
      }
  } else if (count[2] == 2 && count[0] == 1) {
    for (i = 0; i < 3; i++)
      if (strcmp(o[i], "rock") == 0) {
        cout << name[i];
        break;
      }
  } else
    cout << "?";
  return 0;
}
