Elazar ben Dordai, in Avodah Zarah [(17), who did not leave a prostitute upon whom he did not come, heard that there was a prostitute in the coastal cities who took a dinar for her services. He took a dinar and crossed seven rivers. At the time of the festival, she said to him, "Just as the wind does not return, so too Elazar ben Dordai will not be accepted in repentance." He went and sat between mountains and hills and said to them, "Ask for mercy for me." They replied, "Before we ask for mercy for you, we will ask for mercy for ourselves, as it is said, 'For the mountains may depart...' (Isaiah 54:10)." He said to the heavens and the earth, and to the sun, moon, stars, and constellations, "Ask for mercy for me," and they responded to him, etc.
He said, "The matter depends only on me." He placed his head between his knees and wept until his soul departed. A heavenly voice went out and said, "Elazar ben Dordai is destined for the life of the World to Come." Rabbi wept and said, "There is one who acquires his world in one hour and is called Rabbi."] And because he repented, which came from understanding, as it is said, "And his heart will understand" (Hosea 14:10), he returned and was healed for he was worthy to be called Rabbi and to have life in the World to Come, for one who repents is wise. [This was the reincarnation of Yochanan the High Priest, who served for forty years and became a Sadducee.
Therefore, Rabbi wept, "There is one who acquires his world in one hour," what Yochanan the High Priest toiled for forty years (K'subos 19), meaning Yochanan the High Priest toiled for eighty years and lost it in one hour, and this is Elazar, the opposite of him.]
Seder_HaDorot,_Tanaim_and_Amoraim.546:1