The agreement paves the way for Germany's CDU, CSU and SPD to form the country's new government with Friedrich Merz as chancellor.