#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  int p = 0, s = 0, r = 0;
  if (s1[0] == 's') {
    s++;
  } else if (s1[0] == 'p') {
    p++;
  } else if (s1[0] == 'r') {
    r++;
  }
  if (s2[0] == 's') {
    s++;
  } else if (s2[0] == 'p') {
    p++;
  } else if (s2[0] == 'r') {
    r++;
  }
  if (s3[0] == 's') {
    s++;
  } else if (s3[0] == 'p') {
    p++;
  } else if (s3[0] == 'r') {
    r++;
  }
  if (r == 2 && p == 1) {
    if (s1[0] == 'p') {
      cout << "F";
    } else if (s2[0] == 'p') {
      cout << "M";
    } else if (s3[0] == 'p') {
      cout << "S";
    }
  } else if (s == 1 && p == 2) {
    if (s1[0] == 's') {
      cout << "F";
    } else if (s2[0] == 's') {
      cout << "M";
    } else if (s3[0] == 's') {
      cout << "S";
    }
  } else if (r == 1 && s == 2) {
    if (s1[0] == 'r') {
      cout << "F";
    } else if (s2[0] == 'r') {
      cout << "M";
    } else if (s3[0] == 'r') {
      cout << "S";
    }
  } else {
    cout << "?";
  }
  return 0;
}
