The Bodhisatta was once a world famed teacher. Among his pupils was Yava, son of the king of Bārāṇasī. He was a good student, and when he was about to leave, the Bodhisatta, foreseeing danger for him, taught him three verses (the verses are in the nature of conundrums, with double meanings). The first two were based on incidents seen by the Bodhisatta — a horse killing the mouse that worried the sore place in his foot and throwing him into the well; and the same horse, later, trying to eat barley by putting its head through the fence; the third was made of his own accord. Later, Yava became king, and his son, when sixteen years old, made three attempts on his life. However, they all failed because Yava repeated the stanzas taught him by the Bodhisatta. On each occasion, the uttering of the stanzas made the boy feel that he was discovered, and he confessed his guilt, whereupon he was cast into chains.
The story was related in reference to Ajātasattu (J.iii.215‑9). For details see the Thusa Jātaka.