UVA503 Parallelepiped walk

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=7&page=show_problem&problem=444 [PDF](https://uva.onlinejudge.org/external/5/p503.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA503/1f8fbff586de29a2c3b570f014b7c02e23b1d15e.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA503/45d9a2f8c57eea81c38c92d6af71c4ac41d1d317.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA503/3b1c1e7d338d67ad836e76a07dab687dbadff1e8.png)