#include <bits/stdc++.h>
using std::cin;
using std::string;
string x;
int a, b, c;
int main() {
  cin >> x;
  switch (x[0]) {
    case 'r':
      a = 0;
      break;
    case 's':
      a = 2;
      break;
    case 'p':
      a = 5;
      break;
  }
  cin >> x;
  switch (x[0]) {
    case 'r':
      b = 0;
      break;
    case 's':
      b = 2;
      break;
    case 'p':
      b = 5;
      break;
  }
  cin >> x;
  switch (x[0]) {
    case 'r':
      c = 0;
      break;
    case 's':
      c = 2;
      break;
    case 'p':
      c = 5;
      break;
  }
  if (a == b &&
      ((c == 0 && a == 2) || (c == 2 && a == 5) || (c == 5 && a == 0)))
    printf("S");
  else if (b == c &&
           ((a == 0 && b == 2) || (a == 2 && b == 5) || (a == 5 && b == 0)))
    printf("F");
  else if (a == c &&
           ((b == 0 && a == 2) || (b == 2 && a == 5) || (b == 5 && a == 0)))
    printf("M");
  else
    printf("?");
}
