#include using namespace std; signed main(){ string a, b; cin >> a >> b; if( not ( a.size() <= b.size() ) ) swap( a, b ); if( a.size() > 8 ) cout << "P" << endl, exit( 0 ); int x; stringstream ss( a ); ss >> x; if( x == 2 ){ int y = 1e9; if( b.size() <= 8 ){ stringstream sss( b ); sss >> y; } if( y == 2 ) cout << "E" << endl; else cout << "P" << endl; } else if( x == 1 ){ cout << "S" << endl; } else if( x == 0 ){ int y = 1e9; if( b.size() <= 8 ){ stringstream sss( b ); sss >> y; } if( y == 0 ) cout << "E" << endl; else cout << "S" << endl; } else{ cout << "P" << endl; } return 0; }