#include using namespace std; struct Initializer { Initializer() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(15); } } initializer; template inline T toInteger(const string&); template<> inline int toInteger(const string& s) { return stoi(s); } template<> inline long toInteger(const string& s) { return stol(s); } template<> inline long long toInteger(const string& s) { return stoll(s); } template inline T toInteger(const string& s, int n) { T res = 0; for (char c : s) { if (isdigit(c)) res = res * n + c - '0'; else if (isalpha(c)) res = res * n + tolower(c) - 'a' + 10; } return s[0] == '-' ? -res : res; } int main() { string a, b; cin >> a >> b; int x = (a.size() > 1 ? 10 : toInteger(a)); int y = (b.size() > 1 ? 10 : toInteger(b)); if (x + y > x * y) cout << "S" << endl; if (x + y < x * y) cout << "P" << endl; if (x + y == x * y) cout << "E" << endl; }