#include <bits/stdc++.h>
using namespace std;
map<long long int, long long int> mp, mk;
set<long long int> s1, s2;
vector<long long int> v, w;
long long int a[2000006], b[2000006];
string s = "", p = "", q = "";
char ch;
long long int m, n, c, i, j, k, l, r, x, t, y, u, e, f, g, h, mn, mx, d, z;
int main() {
  cin >> s >> p >> q;
  if (s == p && s == q)
    cout << '?';
  else if (s == p) {
    if ((q == "paper" && s == "rock") || (q == "rock" && s == "scissors") ||
        (q == "scissors" && s == "paper"))
      cout << 'S';
    else
      cout << '?';
  } else if (s == q) {
    if ((p == "paper" && s == "rock") || (p == "rock" && s == "scissors") ||
        (p == "scissors" && s == "paper"))
      cout << 'M';
    else
      cout << '?';
  } else if (p == q) {
    if ((s == "paper" && p == "rock") || (s == "rock" && p == "scissors") ||
        (s == "scissors" && p == "paper"))
      cout << 'F';
    else
      cout << '?';
  } else {
    cout << '?';
  }
}
