UVA13246 Chained Words

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=878&page=show_problem&problem=5169 [PDF](https://uva.onlinejudge.org/external/132/p13246.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA13246/f4b420f0bbc87d4017275f920346296301051d8d.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA13246/38667f390a9343bfe682d70dccbef07efcede769.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA13246/62d7a2a8821c771c1886c94b397ce850a9361f56.png)