Surah Yusuf, ayah 22

12:22

وَلَمَّا بَلَغَ أَشُدَّهُۥٓ ءَاتَيۡنَٰهُ حُكۡمٗا وَعِلۡمٗاۚ وَكَذَٰلِكَ نَجۡزِي ٱلۡمُحۡسِنِينَ ٢٢

Walammā balagha ashuddahū ātaynāhu hukman wa'ilman wakadhālika najzil-muhsinīn

And when he [i.e., Joseph] reached maturity, We gave him judgement and knowledge. And thus We reward the doers of good.