ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Неотсортированные > задача:


Permutations

Задачи раздела

• Sum until 0
• Sum less than N
• Sum of N numbers
• The N Queens Problem
• Subsets
• Maximum Sum 2
• Gifts of Santa Claus
• Rectangles on a plane
• Permutations
• Reverse permutation
• Nameplates
• Adjacency matrix to edges list
• Edges list to Adjacency matrix
• Cities and roads
• Cycle detection
• Diameter of graph
• Divisors count

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 1000/1000/1000/1000 мс. Лимит памяти 65000/65000/65000/65000 Кб.

Problem description

You are given a string of N characters. Find all distinct permutations of this string in increasing order.

Input

1 string of N characters where 1<=N<=8.

Output

Write all distinct permutations.

Example

stdin stdout

AB

AB
BA

212

122
212
221

Для отправки решений необходимо выполнить вход.

www.contester.ru