#include <bits/stdc++.h>
using namespace std;
struct node {
  char c;
  int n;
} p[3];
int num(string s) {
  if (s == "paper") return 0;
  if (s == "scissors") return 1;
  if (s == "rock") return 2;
}
bool cmp(node a, node b) { return a.n > b.n; }
int main() {
  string t1, t2, t3;
  cin >> t1 >> t2 >> t3;
  if (t1 == t2 && t2 == t3) {
    cout << "?";
    return 0;
  }
  if (t1 != t2 && t2 != t3 && t3 != t1) {
    cout << "?";
    return 0;
  }
  p[0].n = num(t1);
  p[0].c = 'F';
  p[1].n = num(t2);
  p[1].c = 'M';
  p[2].n = num(t3);
  p[2].c = 'S';
  sort(p, p + 3, cmp);
  if (p[0].n == 1 && p[1].n == 0)
    cout << p[0].c;
  else if (p[0].n == 2 && p[1].n == 1)
    cout << p[0].c;
  else if (p[1].n == 2 && p[2].n == 0)
    cout << p[2].c;
  else
    cout << "?";
  return 0;
}
