시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 512 MB 0 0 0 0.000%

문제

A mage knows $n$ spells, the $i$-th of which requires $q_i$ blue mana, $w_i$ purple mana and $e_i$ orange mana ($q_i + w_i + e_i > 0$). Let's say the mage has $Q$ blue mana, $W$ purple mana and $E$ orange mana, and denote the total amount of mana $Q + W + E$ as $R$. Knowing that the mage is unable to cast any spell, what can be the maximal value of $R$?

입력

The first line contains an integer $n$ ($1 \le n \le 200000$) --- the number of spells.

Each of the next $n$ lines contains three integers $q_i$, $w_i$, $e_i$ ($0 \le q_i, w_i, e_i \le 10^{9}, q_i + w_i + e_i > 0$) --- the manacosts of the $i$-th spell.

출력

Output the maximal total amount of mana $R$ such that the mage is unable to cast any spell.

If this number is infinitely large (for any total amount of mana $R$, there could be a situation so that the mage is unable to cast any spell), output "Infinity".

예제 입력 1

4
0 0 100
0 100 0
100 0 0
61 71 81

예제 출력 1

278

예제 입력 2

6
0 0 100
0 100 0
100 0 0
0 11 61
11 61 0
61 0 11

예제 출력 2

180

예제 입력 3

3
3 1 1
1 3 1
1 1 3

예제 출력 3

Infinity