Polycarpus has many tasks. Each task is characterized by three integers *l*<sub class="lower-index">*i*</sub>, *r*<sub class="lower-index">*i*</sub> and *t*<sub class="lower-index">*i*</sub>. Three integers (*l*<sub class="lower-index">*i*</sub>, *r*<sub class="lower-index">*i*</sub>, *t*<sub class="lower-index">*i*</sub>) mean that to perform task *i*, one needs to choose an integer *s*<sub class="lower-index">*i*</sub> (*l*<sub class="lower-index">*i*</sub> ≤ *s*<sub class="lower-index">*i*</sub>; *s*<sub class="lower-index">*i*</sub> + *t*<sub class="lower-index">*i*</sub> - 1 ≤ *r*<sub class="lower-index">*i*</sub>), then the task will be carried out continuously for *t*<sub class="lower-index">*i*</sub> units of time, starting at time *s*<sub class="lower-index">*i*</sub> and up to time *s*<sub class="lower-index">*i*</sub> + *t*<sub class="lower-index">*i*</sub> - 1, inclusive. In other words, a task is performed for a continuous period of time lasting *t*<sub class="lower-index">*i*</sub>, should be started no earlier than *l*<sub class="lower-index">*i*</sub>, and completed no later than *r*<sub class="lower-index">*i*</sub>.

Polycarpus's tasks have a surprising property: for any task *j*, *k* (with *j* &lt; *k*) *l*<sub class="lower-index">*j*</sub> &lt; *l*<sub class="lower-index">*k*</sub> and *r*<sub class="lower-index">*j*</sub> &lt; *r*<sub class="lower-index">*k*</sub>.

Let's suppose there is an ordered set of tasks *A*, containing |*A*| tasks. We'll assume that *a*<sub class="lower-index">*j*</sub> = (*l*<sub class="lower-index">*j*</sub>, *r*<sub class="lower-index">*j*</sub>, *t*<sub class="lower-index">*j*</sub>) (1 ≤ *j* ≤ |*A*|). Also, we'll assume that the tasks are ordered by increasing *l*<sub class="lower-index">*j*</sub> with the increase in number.

Let's consider the following recursive function *f*, whose argument is an ordered set of tasks *A*, and the result is an integer. The function *f*(*A*) is defined by the greedy algorithm, which is described below in a pseudo-language of programming.
 -  Step 1. <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/1ed3944c0b14c968310c01e937f4516a098d1003.png" style="max-width: 100.0%;max-height: 100.0%;"/>, *ans* = 0. -  Step 2. We consider all tasks in the order of increasing of their numbers in the set *A*. Lets define the current task counter *i* = 0. -  Step 3. Consider the next task: *i* = *i* + 1. If *i* &gt; |*A*| fulfilled, then go to the 8 step. -  Step 4. If you can get the task done starting at time *s*<sub class="lower-index">*i*</sub> = max(*ans* + 1, *l*<sub class="lower-index">*i*</sub>), then do the task *i*: *s*<sub class="lower-index">*i*</sub> = max(*ans* + 1, *l*<sub class="lower-index">*i*</sub>), *ans* = *s*<sub class="lower-index">*i*</sub> + *t*<sub class="lower-index">*i*</sub> - 1, <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/9e0b3f8e2ea4b89161f28f557c6cf3214d2c1959.png" style="max-width: 100.0%;max-height: 100.0%;"/>. Go to the next task (step 3). -  Step 5. Otherwise, find such task <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/dd623995c9aca7918af19266cad3dca474c9e78b.png" style="max-width: 100.0%;max-height: 100.0%;"/>, that first, task *a*<sub class="lower-index">*i*</sub> can be done at time *s*<sub class="lower-index">*i*</sub> = max<img align="middle" class="tex-formula" src="https://espresso.codeforces.com/bdfe105b7ef5bc1282bc7ae868643e2f377e6fc1.png" style="max-width: 100.0%;max-height: 100.0%;"/>, and secondly, the value of <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/78cb8d5ce80fdc3a85f2ade7dd6e3b5e9429a22c.png" style="max-width: 100.0%;max-height: 100.0%;"/> is positive and takes the maximum value among all *b*<sub class="lower-index">*k*</sub> that satisfy the first condition. If you can choose multiple tasks as *b*<sub class="lower-index">*k*</sub>, choose the one with the maximum number in set *A*. -  Step 6. If you managed to choose task *b*<sub class="lower-index">*k*</sub>, then <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/cd4142771dd3e976ac653ce8143d602e52a4e13e.png" style="max-width: 100.0%;max-height: 100.0%;"/>, <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/bd0fe15069bab47edb8c01ebeee403bfd75c592b.png" style="max-width: 100.0%;max-height: 100.0%;"/>. Go to the next task (step 3). -  Step 7. If you didn't manage to choose task *b*<sub class="lower-index">*k*</sub>, then skip task *i*. Go to the next task (step 3). -  Step 8. Return *ans* as a result of executing *f*(*A*). 
Polycarpus got entangled in all these formulas and definitions, so he asked you to simulate the execution of the function *f*, calculate the value of *f*(*A*).
The first line of the input contains a single integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>) — the number of tasks in set *A*. 

Then *n* lines describe the tasks. The *i*-th line contains three space-separated integers *l*<sub class="lower-index">*i*</sub>, *r*<sub class="lower-index">*i*</sub>, *t*<sub class="lower-index">*i*</sub> (1 ≤ *l*<sub class="lower-index">*i*</sub> ≤ *r*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>, 1 ≤ *t*<sub class="lower-index">*i*</sub> ≤ *r*<sub class="lower-index">*i*</sub> - *l*<sub class="lower-index">*i*</sub> + 1) — the description of the *i*-th task.

It is guaranteed that for any tasks *j*, *k* (considering that *j* &lt; *k*) the following is true: *l*<sub class="lower-index">*j*</sub> &lt; *l*<sub class="lower-index">*k*</sub> and *r*<sub class="lower-index">*j*</sub> &lt; *r*<sub class="lower-index">*k*</sub>.
print("_RANDOM_GUESS_1689417084.6695836")# 1689417084.6696