Halum

题目描述

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=26&page=show_problem&problem=2473 [PDF](https://uva.onlinejudge.org/external/114/p11478.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11478/fe7bd946fb4e049b4a2acc693bd285a050d606f4.png)

输入输出格式

输入格式


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

输出格式


![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11478/59cf14738847dcbac078a3ffdf4966090114e0f4.png)

输入输出样例

输入样例 #1

2 1
1 2 10
2 1
1 2 -10
3 3
1 2 4
2 3 2
3 1 5
4 5
2 3 4
4 2 5
3 4 2
3 1 0
1 2 -1

输出样例 #1

Infinite
Infinite
3
1