Sheokand and String

string

#1

what will be the output of this sample input
4
dfgabcdr
sabce
zxabcdex
trabcde
3
3 abcy
3 abcde
4 abcde


#2

You should ask this in the comment of the qustion. No discussion is allowed here!!