import java.util.*; import java.math.*; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); String n1 = sc.next(); String n2 = sc.next(); BigInteger bi1 = new BigInteger(n1); BigInteger bi2 = new BigInteger(n2); BigInteger s = bi1.add(bi2); BigInteger p = bi1.multiply(bi2); if(s.compareTo(p)>0){ System.out.println("S"); }else if(s.compareTo(p)<0){ System.out.println("P"); }else if(s.equals(p) ){ System.out.println("E"); } } }