[Machine] Unlucky is the one who is born unlucky and happy is the one who is born happy. He said, "So I went to Hudhayfah ibn Asid from the companions of the Messenger of Allah ﷺ and I said, 'I am amazed at the status given to the son of the mother of 'Abd, whether he is born unlucky or lucky.' Hudhayfah said to me, 'What surprises you about that, O Abu al-Tufayl? Shall I inform you about something related to this misfortune? The narration goes that there is an angel assigned to the womb for forty-five nights when Allah wills to create whatever He wants with His permission. The angel says, 'O Lord, is it a male or a female?' Your Lord decrees and the angel writes. Then the angel says, 'O Lord, will he be unlucky or lucky?' Your Lord decrees and the angel writes. Then the angel says, 'O Lord, how long will his life be?' Your Lord decrees and the angel writes. Then everything is added or subtracted."
الشَّقِيُّ مَنْ شَقِيَ فِي بَطْنِ أُمِّهِ وَالسَّعِيدُ مَنْ سَعِدَ فِي بَطْنِ أُمِّهِ قَالَ فَأَتَيْتُ حُذَيْفَةَ بْنَ أَسِيدٍ مِنْ أَصْحَابِ رَسُولِ اللهِ ﷺ فَقُلْتُ عَجَبًا لِرَفْعِ ابْنِ أُمِّ عَبْدٍ الشَّقِيُّ مَنْ شَقِيَ فِي بَطْنِ أُمِّهِ قَالَ فَقَالَ لِي حُذَيْفَةُ وَمَا يُعْجِبُكُ مِنْ ذَلِكَ يَا أَبَا الطُّفَيْلِ؟ أَفَلَا أُخْبِرُكَ مِنْ هَذَا بِالشَّقَاءِ؟ وَرَفَعَ الْحَدِيثَ إِنَّ مَلَكًا مُوَكَّلٌ بِالرَّحِمِ بِضْعًا وَأَرْبَعِينَ لَيْلَةً إِذَا أَرَادَ اللهُ أَنْ يَخْلُقَ مَا شَاءَ بِإِذْنِ اللهِ فَيَقُولُ أَيْ رَبِّ أَذَكَرٌ أَمْ أُنْثَى؟ فَيَقْضِي رَبُّكَ وَيَكْتُبُ الْمَلَكُ ثُمَّ يَقُولُ أَيْ رَبِّ أَشَقِيٌّ أَمْ سَعِيدٌ؟ فَيَقْضِي رَبُّكَ وَيَكْتُبُ الْمَلَكُ ثُمَّ يَقُولُ أَيْ رَبِّ أَجَلُهُ؟ فَيَقْضِي رَبُّكَ وَيَكْتُبُ الْمَلَكُ ثُمَّ يُطْوَى مَا زَادَ وَلَا نَقَصَ