Germany and Austria-Hungary defeated ________ but lost _________ as an ally after the nation switched sides