A three-stage dynamic model of financial distress