Hektor has a great many exams this semester. Each exam is described by two integers: the day on which it is held, and the number of days he must spend preparing for it.
Hektor can prepare for only one exam on any single day, and one day of study covers one required preparation day for that exam. Every exam's preparation must be finished on or before the day the exam is held. Hektor may also prepare for an exam on the very day he sits it, because he studies early in the morning while exams take place around noon.
Work out how many days before his earliest exam Hektor must start studying so that he can finish preparing for every exam in time.
The first line contains the number of test groups Z (1≤Z≤10). The descriptions of the test groups follow.
The first line of a single test group contains an integer N (1≤N≤100000), the number of exams. Each of the next N lines contains two positive integers smaller than 10001 describing one exam. The first is the day on which the exam is held, and the second is the number of days needed to prepare for it (that is, 1≤d,p≤10000).
For each test group, print on its own line how many days before that group's earliest exam Hektor must begin studying.