Heroic Hungary reach first major tournament since 1986