Powerless Mage

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

A mage knows nn spells, the ii-th of which requires q_iq\_i blue mana, w_iw\_i purple mana and e_ie\_i orange mana (q_i+w_i+e_i>0q\_i + w\_i + e\_i > 0). Let's say the mage has QQ blue mana, WW purple mana and EE orange mana, and denote the total amount of mana Q+W+EQ + W + E as RR. Knowing that the mage is unable to cast any spell, what can be the maximal value of RR?

입력

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

Each of the next nn lines contains three integers q_iq\_i, w_iw\_i, e_ie\_i (0q_i,w_i,e_i109,q_i+w_i+e_i>00 \le q\_i, w\_i, e\_i \le 10^{9}, q\_i + w\_i + e\_i > 0) --- the manacosts of the ii-th spell.

출력

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

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