Surah Al-Ma'idah, ayah 26

5:26

قَالَ فَإِنَّهَا مُحَرَّمَةٌ عَلَيۡهِمۡۛ أَرۡبَعِينَ سَنَةٗۛ يَتِيهُونَ فِي ٱلۡأَرۡضِۚ فَلَا تَأۡسَ عَلَى ٱلۡقَوۡمِ ٱلۡفَٰسِقِينَ ٢٦

Qāla fa innahā muharramatun 'alayhim arba'īna sanatan yatīhūna fil-ardi falā ta'sa 'alal-qawmil-fāsiqīn

[Allāh] said, "Then indeed, it is forbidden to them for forty years [in which] they will wander throughout the land. So do not grieve over the defiantly disobedient people."