Effective Routing Algorithm for Multilayered Terrestrial-HAP-Satellite Networks