#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long> > v;
long long a[500005];
map<long long, long long> mp;
bool check(long long N, long long pos) { return (bool)(N & (1LL << pos)); }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string f, m, s;
  cin >> f >> m >> s;
  if (m == s && f != m) {
    if ((m == "rock" && f == "paper") || (m == "paper" && f == "scissors") ||
        (m == "scissors" && f == "rock"))
      cout << "F" << '\n';
    else
      cout << "?" << '\n';
  } else if (m == f && s != m) {
    if ((m == "rock" && s == "paper") || (m == "paper" && s == "scissors") ||
        (m == "scissors" && s == "rock"))
      cout << "S" << '\n';
    else
      cout << "?" << '\n';
  } else if (f == s && f != m) {
    if ((f == "rock" && m == "paper") || (f == "paper" && m == "scissors") ||
        (f == "scissors" && m == "rock"))
      cout << "M" << '\n';
    else
      cout << "?" << '\n';
  } else
    cout << "?" << '\n';
}
