#include <bits/stdc++.h>   using namespace std;   string s1, s2, s3;   int win(string s1, string s2) {     if (s1 ==  rock ) {       if (s2 ==  rock ) return 0;       if (s2 ==  scissors ) return 1;       if (s2 ==  paper ) return 2;     }     if (s1 ==  paper ) {       if (s2 ==  rock ) return 1;       if (s2 ==  scissors ) return 2;       if (s2 ==  paper ) return 0;     }     if (s1 ==  scissors ) {       if (s2 ==  rock ) return 2;       if (s2 ==  scissors ) return 0;       if (s2 ==  paper ) return 1;     }   }   int main() {     cin >> s1 >> s2 >> s3;     if (win(s1, s2) == 1 && win(s1, s3) == 1) {       cout <<  F ;       return 0;     }     if (win(s2, s1) == 1 && win(s2, s3) == 1) {       cout <<  M ;       return 0;     }     if (win(s3, s1) == 1 && win(s3, s2) == 1) {       cout <<  S ;       return 0;     }     cout <<  ? ;     return 0;   }   