Scholz to head a minority government with the Social Democrats and the Greens after firing finance minister.