#include <bits/stdc++.h>
using namespace std;
int ident = 0;
string first, second, third;
bool finder(int who, string words[]) {
  int i = 0, counter = 0;
  if (words[who - 1] == "scissors") {
    for (i = 0; i < 3; i++) {
      if (i != (who - 1)) {
        if (words[i] == "paper") {
          counter++;
        }
      }
    }
    if (counter == 2) {
      return true;
    }
  }
  if (words[who - 1] == "paper") {
    for (i = 0; i < 3; i++) {
      if (i != (who - 1)) {
        if (words[i] == "rock") {
          counter++;
        }
      }
    }
    if (counter == 2) {
      return true;
    }
  }
  if (words[who - 1] == "rock") {
    for (i = 0; i < 3; i++) {
      if (i != (who - 1)) {
        if (words[i] == "scissors") {
          counter++;
        }
      }
    }
    if (counter == 2) {
      return true;
    }
  }
  return false;
}
int main() {
  string words[3];
  int C = 0;
  for (int i = 0; i < 3; i++) {
    cin >> words[i];
  }
  for (int i = 1; i <= 3; i++) {
    if (finder(i, words)) {
      C++;
    }
  }
  if (C == 1) {
    for (int i = 1; i <= 3; i++) {
      if (finder(i, words)) {
        if (i == 1) {
          cout << "F";
          return 0;
        } else if (i == 2) {
          cout << "M";
          return 0;
        } else if (i == 3) {
          cout << "S";
          return 0;
        }
      }
    }
  } else {
    cout << "?";
  }
  return 0;
}
