#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[3];
  string s;
  cin >> s;
  if (s == "rock") a[0] = 1;
  if (s == "paper") a[0] = 2;
  if (s == "scissors") a[0] = 3;
  cin >> s;
  if (s == "rock") a[1] = 1;
  if (s == "paper") a[1] = 2;
  if (s == "scissors") a[1] = 3;
  cin >> s;
  if (s == "rock") a[2] = 1;
  if (s == "paper") a[2] = 2;
  if (s == "scissors") a[2] = 3;
  if (a[0] == 1 && a[1] == 3 && a[2] == 3) {
    cout << "F" << endl;
    return 0;
  }
  if (a[0] == 2 && a[1] == 1 && a[2] == 1) {
    cout << "F" << endl;
    return 0;
  }
  if (a[0] == 3 && a[1] == 2 && a[2] == 2) {
    cout << "F" << endl;
    return 0;
  }
  if (a[1] == 1 && a[0] == 3 && a[2] == 3) {
    cout << "M" << endl;
    return 0;
  }
  if (a[1] == 2 && a[0] == 1 && a[2] == 1) {
    cout << "M" << endl;
    return 0;
  }
  if (a[1] == 3 && a[0] == 2 && a[2] == 2) {
    cout << "M" << endl;
    return 0;
  }
  if (a[2] == 1 && a[1] == 3 && a[0] == 3) {
    cout << "S" << endl;
    return 0;
  }
  if (a[2] == 2 && a[1] == 1 && a[0] == 1) {
    cout << "S" << endl;
    return 0;
  }
  if (a[2] == 3 && a[1] == 2 && a[0] == 2) {
    cout << "S" << endl;
    return 0;
  }
  cout << "?" << endl;
  return 0;
}
