HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Fyodor Menshikov. Training > problem:


03B. 50720 - Permutations (2)

Guest
• Discussion of problem (1)

Volume problems

• 01F. 50620 - Poker
• 02A. 50662 - Prime numbers (2)
• 02B. 50625 - Permutations
• 02C. 50626 - The route
• 02D. 50667 - Intersecting Line Seg...
• 02E. 50607 - Long sum
• 02F. 50647 - Spiral
• 03A. 50633 - The prime factors
• 03B. 50720 - Permutations (2)
• 03C. 50615 - Moneybox
• 03D. 50666 - The card and envelope
• 03E. 50606 - Long product
• 03F. 50616 - Snake
• 04A. 50634 - Perfect numbers
• 04B. 50635 - Decomposition into terms
• 04C. 50608 - Gangsters
• 04D. 50627 - Area of a polygon

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Author: Fyodor Menshikov. Difficulty Alpha

Permutations (2)

Russian

You are given a string with length M. You have to show all the possible permutations of the string.

Input
You will be given a string of length M.

Output
You have to show each permutation of the string in a new line. The order in which you output the permutations is not important. However, you shouldn’t show repetitions (the same permutation twice) or lines that aren’t permutations of the original string.
Restrictions

2 ≤ M ≤ 8; The string may contain both Latin alphabet letters or numbers.

Input 1

Input 2

AB

122

Output 1

Output 2

AB
BA

122
212
221

 

Äëÿ îòïðàâêè ðåøåíèé íåîáõîäèìî âûïîëíèòü âõîä.

www.contester.ru