#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  vector<string> arr(3);
  for (auto& x : arr) cin >> x;
  map<string, string> win;
  win["paper"] = "rock";
  win["rock"] = "scissors";
  win["scissors"] = "paper";
  for (int i = 0; i < 3; i++) {
    int cont = 0;
    for (int j = 0; j < 3; j++) {
      if (arr[j] == win[arr[i]]) cont++;
    }
    if (cont == 2) {
      if (i == 0)
        cout << "F" << '\n';
      else if (i == 1)
        cout << "M" << '\n';
      else
        cout << "S" << '\n';
      return 0;
    }
  }
  cout << "?" << '\n';
}
