12560 - Permutation With Repetition   

Description

Given a string of length n, print all permutation of the given string. and repetition of characters is allowed!.

There are few examples below:

Case1:

Input: A

output: A

 

Case2:

Input: AB

output: AA AB BA BB

Input

S

S: the input string ( 2 <= len(S)) < 7)

Note : the input string only contain alpha characters included upercase and lowercase.

Note : each element of input string is different.

Output

Ouput the permutation with repetition pattern (each output string followed by a newline characters)

Sample Input  Download

Sample Output  Download

Tags




Discuss