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

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


Subsets

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

• Cities and roads
• Adjacency matrix to edges list
• Edges list to Adjacency matrix
• Permutations
• Reverse permutation
• Divisors count
• GCD of ones
• Set cover problem
• Subsets
• The N Queens Problem
• Maximum Sum 2
• Gifts of Santa Claus
• Shopping
• Diameter of graph
• Corridor
• Prime numbers
• Rectangles on a plane

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

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

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

Problem description

Make a program that generates all the subsets of a strings set S. Concatenate the members of each subset and print them lexicographic order.

Input

The first line of the input contains an integer N (1<= N <= 20) representing size of the S. Each of the following N lines contain a string (at most 20 letters) consists of English lowercase letters.

Output

Each of the output contains a concatenated subset of S in lexicographic order.

Example

stdin stdout

3
bba
a
abc

a
aabc
aabcbba
abba
abc
abcbba
bba

4
ab
aab
a
b

a
aaab
aaabab
aaababb
aaabb
aab
aabab
aababb
aabb
ab
abb
b

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

www.contester.ru