In line with the Qur'anQur'an 4:86 ↗وَإِذَا حُيِّيتُم بِتَحِيَّةٖ فَحَيُّواْ بِأَحۡسَنَ مِنۡهَآ أَوۡ رُدُّوهَآۗ إِنَّ ٱللَّهَ كَانَ عَلَىٰ كُلِّ شَيۡءٍ حَسِيبًا
When you are greeted with a greeting, respond with a better greeting, or return it. God keeps count of everything.
The verse commands returning a greeting with one as good or better, matching the order to answer the imam's greeting.
In line with the Qur'anQur'an 24:61 ↗لَّيۡسَ عَلَى ٱلۡأَعۡمَىٰ حَرَجٞ وَلَا عَلَى ٱلۡأَعۡرَجِ حَرَجٞ وَلَا عَلَى ٱلۡمَرِيضِ حَرَجٞ وَلَا عَلَىٰٓ أَنفُسِكُمۡ أَن تَأۡكُلُواْ مِنۢ بُيُوتِكُمۡ أَوۡ بُيُوتِ ءَابَآئِكُمۡ أَوۡ بُيُوتِ أُمَّهَٰتِكُمۡ أَوۡ بُيُوتِ إِخۡوَٰنِكُمۡ أَوۡ بُيُوتِ أَخَوَٰتِكُمۡ أَوۡ بُيُوتِ أَعۡمَٰمِكُمۡ أَوۡ بُيُوتِ عَمَّٰتِكُمۡ أَوۡ بُيُوتِ أَخۡوَٰلِكُمۡ أَوۡ بُيُوتِ خَٰلَٰتِكُمۡ أَوۡ مَا مَلَكۡتُم مَّفَاتِحَهُۥٓ أَوۡ صَدِيقِكُمۡۚ لَيۡسَ عَلَيۡكُمۡ جُنَاحٌ أَن تَأۡكُلُواْ جَمِيعًا أَوۡ أَشۡتَاتٗاۚ فَإِذَا دَخَلۡتُم بُيُوتٗا فَسَلِّمُواْ عَلَىٰٓ أَنفُسِكُمۡ تَحِيَّةٗ مِّنۡ عِندِ ٱللَّهِ مُبَٰرَكَةٗ طَيِّبَةٗۚ كَذَٰلِكَ يُبَيِّنُ ٱللَّهُ لَكُمُ ٱلۡأٓيَٰتِ لَعَلَّكُمۡ تَعۡقِلُونَ
There is no blame on the blind, nor any blame on the lame, nor any blame on the sick, nor on yourselves for eating at your homes, or your fathers’ homes, or your mothers’ homes, or your brothers’ homes, or your sisters’ homes, or the homes of your paternal uncles, or the homes of your paternal aunts, or the homes of your maternal uncles, or the homes of your maternal aunts, or those whose keys you own, or the homes of your friends. You commit no wrong by eating together or separately. But when you enter any home, greet one another with a greeting from God, blessed and good. God thus explains the revelations for you, so that you may understand.
The verse commands greeting one another with a blessed greeting from God, matching the order to greet each other.
In line with the Qur'anQur'an 49:10 ↗إِنَّمَا ٱلۡمُؤۡمِنُونَ إِخۡوَةٞ فَأَصۡلِحُواْ بَيۡنَ أَخَوَيۡكُمۡۚ وَٱتَّقُواْ ٱللَّهَ لَعَلَّكُمۡ تُرۡحَمُونَ
The believers are brothers, so reconcile between your brothers, and remain conscious of God, so that you may receive mercy.
The verse declares believers brothers, matching the order that believers love one another.