print((function (s) if s == "0 0" or s == "2 2" then return "E" end for e in s:gmatch("%d+") do if e == "0" or e == "1" then return "S" end end return "P" end)(io.stdin:read("*l")))