$x = nil i, j = gets.chomp.map(:to_i) puts$x="S" if i == 1 || j == 1 puts$x="E" if i == 2 && j == 2 puts "P" if !$x