Permutations with repetition

Write a program that, given nn different words s1,,sns_1, \dots, s_n, prints all the permutations with repetitions that can be made with the words.

Input

Input consists of a natural number n>0n > 0, followed by s1,,sns_1, \dots, s_n.

Output

Print all the permutations with repetitions that can be made with s1,,sns_1, \dots, s_n.

Information about the checker

You can print the solutions to this exercise in any order.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T10:03:17.582Z

© Jutge.org, 2006–2026.
https://jutge.org