Cogeneration for heat, power and CO2