rps logic