#include <bits/stdc++.h>
using namespace std;
map<string, int> a;
int func(int x, int y) {
  if ((x + 1) % 3 == y) return x;
  return y;
}
int main() {
  a["rock"] = 2;
  a["paper"] = 1;
  a["scissors"] = 0;
  char c[10];
  int x, y, z, i;
  cin >> c;
  x = a[c];
  cin >> c;
  y = a[c];
  cin >> c;
  z = a[c];
  if (x == y && y == z) {
    cout << "\?\n";
    return 0;
  }
  if (x != y && y != z && z != x) {
    cout << "\?\n";
    return 0;
  }
  int val, t;
  char p;
  if (x == y) {
    val = x;
    p = '\?';
  } else {
    val = func(x, y);
    if (val == x)
      p = 'F';
    else
      p = 'M';
  }
  if (val == z) {
    p = '\?';
  } else {
    val = func(val, z);
    if (val == z) p = 'S';
  }
  cout << p << endl;
  return 0;
}
