#include <bits/stdc++.h>
using namespace std;
int A[100 + 10];
bool check(string a, string b) {
  if (a[0] == 'r' && b[0] == 'p') return 1;
  if (a[0] == 's' && b[0] == 'r') return 1;
  if (a[0] == 'p' && b[0] == 's') return 1;
  return 0;
}
void sentai() {
  string a, b, c;
  cin >> a >> b >> c;
  if (a == b && b == c || a != b && b != c && a != c) {
    cout << "?";
    return;
  }
  if (a == b) {
    if (check(a, c)) cout << "S", exit(0);
  }
  if (a == c) {
    if (check(a, b)) cout << "M", exit(0);
  }
  if (b == c) {
    if (check(b, a)) cout << "F", exit(0);
  }
  cout << "?";
}
int main() {
  ios_base::sync_with_stdio(false);
  ;
  int t = 1;
  while (t--) {
    sentai();
    if (t) cout << "\n";
  }
  return 0;
}
