Hadithcore
Mishkat al-Masabih, 202

Ibn Mas'ud reported God’s messenger as saying, “Two people only may be envied:

a man to whom God has given property, empowering him to dispose of it on what is right; and a man to whom God has given wisdom who acts according to it and teaches it.” (Bukhari and Muslim).

وَعَنِ ابْنِ مَسْعُودٍ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: " لَا حَسَدَ إِلَّا فِي اثْنَتَيْنِ رَجُلٍ آتَاهُ اللَّهُ مَالًا فَسَلَّطَهُ عَلَى هَلَكَتِهِ فِي الْحَقِّ وَرَجُلٍ آتَاهُ اللَّهُ الْحِكْمَة فَهُوَ يقْضِي بهَا وَيعلمهَا)

References1 variant
In-Book Reference
Book 2, Hadith 5