I have heard that on one occasion the Blessed One was staying near Āḷavī in the haunt of the Āḷavaka yakkha. Then the Āḷavaka yakkha went to the Blessed One and on arrival said to him: “Get out, contemplative!”
(Saying,) “All right, my friend,” the Blessed One went out.
“Come in, contemplative!”
(Saying,) “All right, my friend,” the Blessed One went in.
A second time… A third time, the Āḷavaka yakkha said to the Blessed One, “Get out, contemplative!”
(Saying,) “All right, my friend,” the Blessed One went out.
“Come in, contemplative!”
(Saying,) “All right, my friend,” the Blessed One went in.
Then a fourth time, the Āḷavaka yakkha said to the Blessed One, “Get out, contemplative!”
“I won’t go out, my friend. Do what you have to do.”
“I will ask you a question, contemplative. If you can’t answer me, I will possess your mind or rip open your heart or, grabbing you by the feet, hurl you across the Ganges.”
“My friend, I see no one in the cosmos with its devas, Māras & Brahmās, its contemplatives & brahmans, its royalty & commonfolk, who could possess my mind or rip open my heart or, grabbing me by the feet, hurl me across the Ganges. But nevertheless, ask me what you wish.”
Āḷavaka: “What is a person’s highest wealth? What, when well-practiced, brings bliss? What is the highest of savors? Living in what way is one’s life called the best?” The Buddha: “Conviction is a person’s highest wealth. Dhamma, when well-practiced, brings bliss. Truth is the highest of savors.1 Living with discernment, one’s life is called best.” Āḷavaka: “How does one cross over the flood? How cross over the sea? How does one overcome suffering & stress? How is a person purified?” The Buddha: “Through conviction one crosses over the flood. Through heedfulness, the sea. Through persistence one overcomes suffering & stress. Through discernment a person is purified.” Āḷavaka: “How does one gain discernment? How does one find wealth? How does one attain honor? How bind friends to oneself? Passing from this world to the next world, how does one not grieve?” The Buddha: “Convinced of the arahants’ Dhamma for attaining unbinding, —heedful, observant— one listening well gains discernment. Doing what’s fitting, enduring burdens, one with initiative finds wealth. Through truth one attains honor. Giving binds friends to oneself. Endowed with these four qualities, —truth, self-control, stamina, relinquishment— a householder of conviction, on passing away, doesn’t grieve. Now, go ask others, common brahmans & contemplatives, if anything better than truth, self-control, stamina, & relinquishment here can be found.” Āḷavaka: “How could I go ask common brahmans & contemplatives?— now that today I understand what benefits the next life. It was truly for my well-being that the Awakened One came to stay in Āḷavī. Today I understand where what is given bears great fruit. I’ll wander from village to village, town to town, paying homage to the Self-awakened One & the true rightness of the Dhamma.”
Source https://www.dhammatalks.org/suttas/SN/SN10_12.html which has the following copyright: https://creativecommons.org/licenses/by-nc/4.0/ The author of www.dhammatalks.org also states: “There is some uncertainty about the meaning of ‘Commercial’ with regard to the CC NonCommercial License. For example, some consider the sale of content to support a non-profit entity to be ‘NonCommercial.’ The author and copyright holder of the content on this site considers any sale, including by non-profit entities for non-profit purposes, to be ‘Commercial’ and a copyright violation.“