I found out about the Besangar inscription on which some sanskrit shlokas are written. According to Wikipedia, they belong to Mahabharata
The second inscription on the pillar, in the same script, recites a verse from the Hindu epic Mahabharata:[22][26]
Line 1. (These?) three steps to immortality, when correctly followed,
Line 2. lead to heaven: control, generosity, and attention.
Please give exact refrence for this shloka.