There are n{n}n dragons in a row, indexed 1 through n{n}n. 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 q{q}q events in order. Each event has one of the following types. Training Given l,r,x{l, r, x}l,r,x, for all dragons of level x{x}x with indices between l{l}l to r{r}r inclusive, increase their levels to x+1{x+1}x+1; Defense Given l,r{l, r}l,r, find the maximum level of dragons with indices between l{l}l to r{r}r inclusive.
Hey, look, what's that? It's dragons in dragons' descent! There are n{n}n dragons in a row, indexed 1 through n{n}n. 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 q{q}q events in order. Each event has one of the following types. Training Given l,r,x{l, r, x}l,r,x, for all dragons of level x{x}x with indices between l{l}l to r{r}r inclusive, increase their levels to x+1{x+1}x+1; Defense Given l,r{l, r}l,r, find the maximum level of dragons with indices between l{l}l to r{r}r inclusive.