The Bodhisatta was once born as Ádásamukha, son of Janasandha, king of Benares. Ádásamukha became king at the age of seven, having successfully solved the problems set him by his courtiers.
Janasandha had a servant named Gámani-Canda who, being old, retired when Ádásamukha came to the throne. But various mishaps befell Gámani-Canda, and he was charged on various counts by different people. As he was being brought to the king to receive punishment, he was asked by several persons to convey messages to the king, and to find out from him solutions for their troubles.
The king listened to the charges brought against Gámani and to his explanation of them. Convinced of Gámani's innocence, he passed sentences which ultimately brought gain to Gámani. The king then proceeded to solve the problems contained in the messages brought by Gámani. He gave to Gámani the village in which he lived, free from all taxes, and there Gámani lived happily to the end of his days.
The story was told by the Buddha to certain monks who had been discussing his wisdom.
Gámani-Canda is identified with Ananda. In the story he is referred to also as Gámani, Canda-Gámani and Canda. J.ii.297-310.