#include <bits/stdc++.h>
using namespace std;
long long n, m, a, b, x, cnt, ans;
string s1 = "rock", s2 = "paper", s3 = "scissors", s4;
map<string, int> mp;
vector<string> V;
int main() {
  for (int i = 1; i <= 3; i++) {
    cin >> s4;
    mp[s4]++;
    V.push_back(s4);
  }
  if (mp[s1] == 2 && mp[s2] == 1) {
    for (int i = 0; i < V.size(); i++) {
      if (V[i] == s2) {
        if (i == 0)
          cout << "F" << endl;
        else if (i == 1)
          cout << "M" << endl;
        else
          cout << "S" << endl;
        return 0;
      }
    }
  } else if (mp[s3] == 2 && mp[s1] == 1) {
    for (int i = 0; i < V.size(); i++) {
      if (V[i] == s1) {
        if (i == 0)
          cout << "F" << endl;
        else if (i == 1)
          cout << "M" << endl;
        else
          cout << "S" << endl;
        return 0;
      }
    }
  } else if (mp[s2] == 2 && mp[s3] == 1) {
    for (int i = 0; i < V.size(); i++) {
      if (V[i] == s3) {
        if (i == 0)
          cout << "F" << endl;
        else if (i == 1)
          cout << "M" << endl;
        else
          cout << "S" << endl;
        return 0;
      }
    }
  } else
    cout << "?" << endl;
}
