#include using namespace std; long long f(string s){ long long x = 0; for(int i = 0 ; i < s.size() ; i++){ x = x * 10 + s[i] - '0'; if( x >= 10 ) return x; } return x; } int main(){ string A,B; cin >> A >> B; long long a = f(A); long long b = f(B); if( a + b < a*b ){ cout << "P" << endl; }else if( a + b > a*b ){ cout << "S" << endl; }else{ cout << "E" << endl; } }