#include <bits/stdc++.h>
using namespace std;
template <typename T>
static ostream& operator<<(ostream& stream, const vector<T>& t);
template <typename T>
static istream& read(T, T, istream& = cin);
template <typename T>
static istream& operator>>(istream& stream, vector<T>& t) {
  return read((t).begin(), (t).end(), stream);
}
template <typename T>
static istream& read(T b, T e, istream& stream) {
  for (T it = b; it != e; ++it) stream >> *it;
  return stream;
}
struct _print {
  string sep, end;
  bool space;
  ostream& stream;
  _print(string _sep = " ", string _end = "\n", ostream& _stream = cout)
      : sep(_sep), end(_end), space(false), stream(_stream) {}
  ~_print() { stream << end; }
  template <typename T>
  _print& operator,(const T& t) {
    if (space) stream << sep;
    space = true;
    stream << t;
    return *this;
  }
};
bool wins(string s, string t) {
  if (s == "rock" && t == "scissors") return true;
  if (s == "paper" && t == "rock") return true;
  if (s == "scissors" && t == "paper") return true;
  return false;
}
void _() {
  vector<string> arr(3);
  cin >> arr;
  for (int i = 0; i < 3; ++i) {
    bool ok = true;
    for (int j = 0; j < 3; ++j)
      if (i != j)
        if (!wins(arr[i], arr[j])) ok = false;
    if (ok) {
      _print(), "FMS"[i];
      return;
    }
  }
  _print(), "?";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed << setprecision(15);
  _();
}
