The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 6 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Aman loves solving English puzzles. His teacher taught him a new topic today called Contiguous Words.
A contiguous word is a word in which all the occurrences of each letter of the word is together (i.e. no same letter should be separated by one or more other letters). For example,
"aaabb" and "abc" are contiguous word.
"bitotsav" is not a contiguous word since the 't's don't occur together.
For the weekends the teacher gave Aman a homework on contiguous word. The homework is as follows:
The teacher divided contiguous word into several parts. Aman has to form the original contiguous word and print it. If more than one contiguous word can be formed print "MORE THAN ONE". If a contiguous word cannot be formed from the given parts print "NOT POSSIBLE" (all quotes for clarity).
Input Specification
Output Specification
Constraints
Sample Input
4
3
zzzz zz z
2
ro ar
3
ro a r
2
ac cca
Sample Output
zzzzzzz
arro
MORE THAN ONE
NOT POSSIBLE
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll