UVA10102 The path in the colored field

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=13&page=show_problem&problem=1043 [PDF](https://uva.onlinejudge.org/external/101/p10102.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10102/7df822fba839377f8d360480f9b10f0f7421603a.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10102/6784491be45124eccdde86ede4821ab3e8dec2b0.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10102/4971115d9c40a05d3d16792d80cf525184ecb734.png)