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