The deleveraging of households and firms