#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vpii = vector<pair<int, int>>;
using vc = vector<char>;
using vvc = vector<vc>;
long long binpow(long long a, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) res *= a;
    a *= a;
    n >>= 1;
  }
  return res;
}
bool prime(long long n) {
  for (long long i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) return false;
  }
  return true;
}
int gcd(int a, int b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
long long lcm(int a, int b) { return a / gcd(a, b) * b; }
template <class T1, class T2>
void Cin_vector(vector<T1>& a, T2 n) {
  for (auto& val : a) {
    std::cin >> val;
  }
}
template <class T1, class T2>
void Cout_vector(vector<T1>& a, T2 n) {
  for (auto& val : a) {
    std::cout << val << ' ';
  }
}
template <class T1, class T2, class T3>
void Cin_matrix(vector<vector<T1>>& a, T2 n, T3 m) {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      std::cin >> a[i][j];
    }
  }
}
template <class T1, class T2, class T3>
void Cout_matrix(vector<vector<T1>>& a, T2 n, T3 m) {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      std::cout << a[i][j] << ' ';
    }
    std::cout << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  vector<string> otvet(3);
  otvet[0] = "F", otvet[1] = "M", otvet[2] = "S";
  vector<string> strs;
  map<string, int> counts;
  for (int i = 0; i < 3; i++) {
    string s;
    std::cin >> s;
    strs.push_back(s);
    counts[s]++;
  }
  int maxs = 0;
  string temp;
  for (auto& [strings, cnt] : counts) {
    if (cnt > maxs) {
      maxs = cnt;
      temp = strings;
    }
  }
  if (maxs == 1 || maxs == 3) {
    std::cout << "?";
  } else {
    string c;
    for (auto& [strings, cnt] : counts) {
      if (strings != temp) {
        c = strings;
      }
    }
    if (temp == "rock" && c == "paper" || temp == "paper" && c == "scissors" ||
        temp == "scissors" && c == "rock") {
      for (int i = 0; i < 3; i++) {
        if (c == strs[i]) {
          std::cout << otvet[i];
          break;
        }
      }
    } else {
      std::cout << '?';
    }
  }
}
