Permutations X10466


Statement
 

pdf   zip

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

Input

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

Output

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

Information about the checker

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

Public test cases
  • Input

    3
    hola adeu hi
    

    Output

    (hola,adeu,hi)
    (hola,hi,adeu)
    (adeu,hola,hi)
    (adeu,hi,hola)
    (hi,hola,adeu)
    (hi,adeu,hola)
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    Unknown.
    User solutions