DE, PL, CZ, SK, HU
It does not run through Prague. It runs through Poland and then crosses CZ from Ostrava to Břeclav. Then SK (Kúty, Bratislava, Štúrovo) and then HU.
Actually in central Europe the night trains usually join and split at some stations, so in Ostrava two trains join: from Berlin and from Warsaw. Then in Břeclav they split again (two halves from each half), one goes to Vienna, another to Budapest. So at the beginning there are two parts on each train and you have to choose the right one. But since the places have to be reserved, you cannot get on the wrong half.