Sayyiduna Ibn Abbas (may Allah be pleased with them both) said: Some of the captives of Badr had no ransom (to pay). The Messenger of Allah (peace and blessings be upon him) made their ransom that they teach the children of the Ansar to write. One day a boy from the Ansar came to his father crying. His father asked: What is the matter? He said: My teacher hit me. He said: The wretch is seeking revenge for Badr. By Allah! Do not go to him again.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الإجارة / 11680