Ensure that you are logged in and have the required permissions to access the test.
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.