Write a program that, given different words , prints all the permutations with repetitions that can be made with the words.
Input consists of a natural number , followed by .
Print all the permutations with repetitions that can be made with .
You can print the solutions to this exercise in any order.
Input
3 hola adeu hi
Output
(hola,hola,hola) (hola,hola,adeu) (hola,hola,hi) (hola,adeu,hola) (hola,adeu,adeu) (hola,adeu,hi) (hola,hi,hola) (hola,hi,adeu) (hola,hi,hi) (adeu,hola,hola) (adeu,hola,adeu) (adeu,hola,hi) (adeu,adeu,hola) (adeu,adeu,adeu) (adeu,adeu,hi) (adeu,hi,hola) (adeu,hi,adeu) (adeu,hi,hi) (hi,hola,hola) (hi,hola,adeu) (hi,hola,hi) (hi,adeu,hola) (hi,adeu,adeu) (hi,adeu,hi) (hi,hi,hola) (hi,hi,adeu) (hi,hi,hi)