מועד קטן ג:א · Moed Katan 3:1

וְאֵלּוּ מְגַלְּחִין בַּמּוֹעֵד, הַבָּא מִמְּדִינַת הַיָּם, וּמִבֵּית הַשִּׁבְיָה, וְהַיּוֹצֵא מִבֵּית הָאֲסוּרִין, וְהַמְנֻדֶּה שֶׁהִתִּירוּ לוֹ חֲכָמִים, וְכֵן מִי שֶׁנִּשְׁאַל לְחָכָם וְהֻתַּר, וְהַנָּזִיר, וְהַמְּצֹרָע הָעוֹלֶה מִטֻּמְאָתוֹ לְטָהֳרָתוֹ:
And these may shave and cut their hair on the intermediate days of a Festival: One who comes from a country overseas; and one who is released from a house of captivity; and one who comes out of prison on the intermediate days of a Festival; and one who had been ostracized and therefore prohibited from cutting his hair, and the Sages released him from his decree of ostracism on the intermediate days of the Festival; and similarly, one who had vowed not to cut his hair and then requested of a Sage to dissolve his vow and was released from it on the intermediate days of the Festival; and the nazirite whose term of naziriteship ended on the intermediate days of a Festival; and the leper who needs to purify himself on the intermediate days and must shave his entire body in order to leave his state of ritual impurity and regain his ritual purity. Since these people were not able to cut their hair on the eve of the Festival, they are permitted to do so on the intermediate days of the Festival.

Word-by-word Breakdown (מילים ושרשים)

וְאֵלּוּ → And these [א - ל - ל]מְגַלְּחִין → may shave [ג - ל - ח]בַּמּוֹעֵד → on the Festival [י - ע - ד]הַבָּא → One who comes [ב - ו - א]מִמְּדִינַת → from a country [ד - י - נ]הַיָּם → overseas [י - ם]וּמִבֵּית → and from a house [ב - י - ת]הַשִּׁבְיָה → of captivity [ש - ב - ה]וְהַיּוֹצֵא → and one who goes out [י - צ - א]מִבֵּית → from a house [ב - י - ת]הָאֲסוּרִין → of prisoners [א - ס - ר]וְהַמְנֻדֶּה → and one who was ostracized [נ - ד - ה]שֶׁהִתִּירוּ → that released [ה - ת - ר]לוֹ → him חֲכָמִים → the Sages [ח - כ - ם]וְכֵן → and similarly [כ - ו - ן]מִי → one who שֶׁנִּשְׁאַל → requested [ש - א - ל]לְחָכָם → of a Sage [ח - כ - ם]וְהֻתַּר → and was released [ה - ת - ר]וְהַנָּזִיר → and the nazirite [נ - ז - ר]וְהַמְּצֹרָע → and the leper [צ - ר - ע]הָעוֹלֶה → who ascends [ע - ל - ה]מִטֻּמְאָתוֹ → from his impurity [ט - מ - א]לְטָהֳרָתוֹ → to his purity [ט - ה - ר]