Sunan Ibn Majah, Book 23, Hadith 2845 (In-Book)

It was narrated that Ibn ‘Abbas said: “The Messenger of Allah said: ‘Distribute wealth among those who are entitled to shares of inheritance, according to the Book of Allah, then whatever is left over goes to the nearest male relative.’”

حَدَّثَنَا الْعَبَّاسُ بْنُ عَبْدِ الْعَظِيمِ الْعَنْبَرِيُّ، حَدَّثَنَا عَبْدُ الرَّزَّاقِ، أَنْبَأَنَا مَعْمَرٌ، عَنِ ابْنِ طَاوُسٍ، عَنْ أَبِيهِ، عَنِ ابْنِ عَبَّاسٍ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ اقْسِمُوا الْمَالَ بَيْنَ أَهْلِ الْفَرَائِضِ عَلَى كِتَابِ اللَّهِ فَمَا تَرَكَتِ الْفَرَائِضُ فَلأَوْلَى رَجُلٍ ذَكَرٍ ‏" ‏ ‏.‏

sunnah.com