Ensure that you are logged in and have the required permissions to access the test.

Lexicographical sorted words

1

1 votes
Problem

Given set of words that are lexicographically sorted, find the grammar

Eg:
abc
acd
bcc
bed
bdc
dab

For e.g. For the above case, the order of letters for the given example would be: a b c e d

INPUT

There are six strings in input. Length of each string is 3. You have to scan these six strings and apply your algorithm.

OUTPUT

Print the grammer. Put space between each character. See sample input output for more clarity.

Sample Input
abc
acd
bcc
bed
bdc
dab
Sample Output
a b c e d
Time Limit: 2
Memory Limit: 256
Source Limit:
Editor Image

?