UVA12335 Lexicographic Order

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=278&page=show_problem&problem=3757 [PDF](https://uva.onlinejudge.org/external/123/p12335.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12335/0eea37bb7e837ce3690c5cf38ab40f046b45a691.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12335/6b603127af82ee6c0e2ffb9361f279f48b842a18.png)