#include <bits/stdc++.h>
using namespace std;
int main() {
  char str1[10], str2[10], str3[10];
  int flag1, flag2, flag3;
  flag1 = 0;
  flag2 = 0;
  flag3 = 0;
  cin >> str1 >> str2 >> str3;
  if (strcmp(str1, str2) == 0) {
    flag1 = 1;
  } else if (strcmp(str2, str3) == 0) {
    flag2 = 1;
  } else if (strcmp(str3, str1) == 0) {
    flag3 = 1;
  }
  if ((flag1 | flag2 | flag3) == 0) {
    cout << '?' << endl;
    return 0;
  }
  if ((flag1 & flag2 & flag3) == 1) {
    cout << '?' << endl;
    return 0;
  }
  if (flag1 == 1) {
    if (strcmp(str3, "rock") == 0) {
      if (strcmp(str2, "scissors") == 0) {
        cout << 'S' << endl;
        return 0;
      }
    }
    if (strcmp(str3, "scissors") == 0) {
      if (strcmp(str2, "paper") == 0) {
        cout << 'S' << endl;
        return 0;
      }
    }
    if (strcmp(str3, "paper") == 0) {
      if (strcmp(str2, "rock") == 0) {
        cout << 'S' << endl;
        return 0;
      }
    }
  }
  if (flag2 == 1) {
    if (strcmp(str1, "rock") == 0) {
      if (strcmp(str2, "scissors") == 0) {
        cout << 'F' << endl;
        return 0;
      }
    }
    if (strcmp(str1, "scissors") == 0) {
      if (strcmp(str2, "paper") == 0) {
        cout << 'F' << endl;
        return 0;
      }
    }
    if (strcmp(str1, "paper") == 0) {
      if (strcmp(str2, "rock") == 0) {
        cout << 'F' << endl;
        return 0;
      }
    }
  }
  if (flag3 == 1) {
    if (strcmp(str2, "rock") == 0) {
      if (strcmp(str3, "scissors") == 0) {
        cout << 'M' << endl;
        return 0;
      }
    }
    if (strcmp(str2, "scissors") == 0) {
      if (strcmp(str3, "paper") == 0) {
        cout << 'M' << endl;
        return 0;
      }
    }
    if (strcmp(str2, "paper") == 0) {
      if (strcmp(str3, "rock") == 0) {
        cout << 'M' << endl;
        return 0;
      }
    }
  }
  cout << '?' << endl;
  return 0;
}
