Allah the Almighty narrated: And there were gathered before Solomon his hosts of jinns and men, and birds, and they all were set in battle order (marching forwards). Till, when they came to the valley of the ants, one of the ants said: "0 ants! Enter your dwellings, lest Solomon and his hosts crush you, while they perceive not."
So he (Solomon) smiled, amused at her speech and said: 'My Lord! Inspire and bestow upon me the power and ability that I may be grateful for Your Favors which You have bestowed on me and on my parents, and that I may do righteous good deeds that will please You, and admit me by Your Mercy among Your righteous slaves." Surah 27: 17-19