Task: Program Execution
Input (English): the, M, amain,, G, kingdoms,, R, had, f, m, z, P, water, Z, X, hooded, s
Output (English): theMamain,Gkingdoms,RhadfmzPwaterZXhoodeds