UVA642 Word Amalgamation

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=8&page=show_problem&problem=583 [PDF](https://uva.onlinejudge.org/external/6/p642.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA642/798288cf0a5caae5367a31141c3cf2e90bd3b5cb.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA642/d85b48af6838aac4769be70e174b7480fc2b98e7.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA642/d8237ee3b00c49d0666058cf53b6b711aad2bdf6.png)