When does a bill produced by committee members go to the Rules Committee?

Abefore the bill is written
Cafter the bill has been debated
Bduring the writing of the bill
Dafter the bill has been approved by a committee