import java.io.*; import java.util.*; public class Main_yukicoder441 { private static Scanner sc; private static Printer pr; private static void solve() { String a = sc.next(); String b = sc.next(); if (isZero(a) && isZero(b)) { pr.println("E"); } else if (isZero(a) && !isZero(b)) { pr.println("S"); } else if (!isZero(a) && isZero(b)) { pr.println("S"); } else if (isOne(a) || isOne(b)) { pr.println("S"); } else if (a.length() == 1 && b.length() == 1) { int aa = Integer.parseInt(a); int bb = Integer.parseInt(b); if (aa + bb > aa * bb) { pr.println("S"); } else if (aa + bb < aa * bb) { pr.println("P"); } else { pr.println("E"); } } else { pr.println("P"); } } private static boolean isZero(String a) { if (a.length() == 1 && Integer.parseInt(a) == 0) { return true; } else { return false; } } private static boolean isOne(String a) { if (a.length() == 1 && Integer.parseInt(a) == 1) { return true; } else { return false; } } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }