Bankruptcy, bubbles and bailouts