The rim. The seat, provided it is solidly built and attached. Anecdotally I feel quite stable either way.
Edit: the trick to perching on various narrow surfaces, for me, is to have the heel on one side an the ball of the foot on the other. "Gripping" as it were.
Edit: the trick to perching on various narrow surfaces, for me, is to have the heel on one side an the ball of the foot on the other. "Gripping" as it were.