Hey, look, what's that? It's dragons in dragons' descent!
There are

dragons in a row, indexed 1 through

. Every dragon has a level, and initially, every dragon is of level 0.
You are a hero of the league of explorers. And your task is to counter the attack of the league of evil.
You are training the dragons in peacetime. When the villains launched a battle, you have to select the best dragon to defend.
Specifically, you have to process

events in order. Each event has one of the following types.
Training Given

, for all dragons of level

with indices between

to

inclusive, increase their levels to

;
Defense Given

, find the maximum level of dragons with indices between

to

inclusive.