#include <iostream> #include <algorithm> #include <functional> #include <string> #include <climits> #include <vector> #include <numeric> #include <complex> #include <map> #include <bitset> #include <stack> #include <queue> #include <set> #include <stdlib.h> using namespace std; //#define __int64 long long #define REP(i,a,b) for(int i=a;i<b;i++) #define rep(i,n) REP(i,0,n) const int Vec = 4; const int Vecy[Vec] = {0,-1,0,1}; const int Vecx[Vec] = {1,0,-1,0}; const int Modd = 1000000007; int main(){ string a,b; int mind; cin >> a >> b; if(a.length() >= 2 && b.length() >= 2){ cout << "P" << endl; }else{ if(a.length() == 1 && b.length() == 1){ int a2 = atoi(a.c_str()); int b2 = atoi(b.c_str()); if(a2 + b2 < a2 * b2){ cout << "P" << endl; }else if(a2 + b2 > a2 * b2){ cout << "S" << endl; }else{ cout << "E" << endl; } return 0; }else{ if(a.length() == 1){ if(a[0] == '0' || a[0] == '1'){ cout << "S" << endl; return 0; } } if(b.length() == 1){ if(b[0] == '0' || b[0] == '1'){ cout << "S" << endl; return 0; } } cout << "P" << endl; } } return 0; }