In several traditions, a righteous and edifying Videhan King Nimi or Nemi is mentioned, who travels to
heaven and
hell in a celestial chariot. The story is mentioned in one text of the
Pāli Canon, and two Pāli
post-canonical texts. The name Nimi or Nemi is explained as "he brings the lineage full circle like the rim () of a carriage wheel". The story relates that a certain King Makhadeva tells his barber that the latter should warn him as soon as the king has his first grey hair, a common
memento mori motif found in ancient Indian literature, which goes back to the ancient Indian
conception of stages of life. Later on, when his first hairs go grey, and his barber tells him about that, the king
goes forth to lead a spiritual life as a
hermit, but not before he entrusts his son to do the same when his hair goes grey. The former king is later reborn in a heavenly world. He sees that his descendants all follow the same tradition of becoming hermits when they became old. He then decides to be reborn as the next descendant of the same dynasty, and has the name King Nimi. The story then goes on to say that this king is able to travel to heaven and hell at the invitation of the god
Sakka. At the end of the story, King Makhadeva, later reborn as Nimi, is identified as a previous birth of
the Buddha, and the barber and heavenly charioteer are identified as the disciple
Ānanda. The story is mentioned in many other
early Buddhist texts, both canonical and post-canonical. The story of King Nimi visiting heaven and hell is iconic in traditional
Thai art, and is easily recognizable for the average Thai person. This story, as well as many similar stories that deal with
cakravartin kings, attempts to establish that the spiritual life of renunciation is superior to the worldly life, and the solitary life superior to a married life. Moreover, Asian religion scholar Naomi Appleton argues that there is a connection between the stories of the Videhan renouncing kings and the ideal of the
solitary Buddha in Buddhism. Solitary Buddhas are often depicted renouncing their worldly life because of certain signs in their environment or on their body, as in the case of Makkhadeva. Finally, according to the scholar
Padmanabh Jaini, the story may also have influenced how Buddhist cosmology was interpreted. In post-canonical
Pāli works, the belief is expressed that King Nimi belongs to a long line of Kings descending from
Mahāsammata, the first king of humankind. The Buddha is believed to be a descendant of the same dynasty. == Jainism ==