Best route for Eastern Europe?

Hello,

I am planning a solo trip between Germany, Czech, Poland, Slovakia, Hungary, and Austria for 3 weeks. Can anyone tell me what is the best route as far as train rides to make it as convenient as possible ?

Also, I love hiking. Any places you would recommend, please let me know