G. Queries
time limit per test
2.5 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Initially there are two arrays $$$a$$$ and $$$b$$$ of length $$$n$$$ filled with zeros. You need to process $$$q$$$ updates and queries of the following types:

1. For each $$$i$$$ such, that $$$l \leq i \leq r$$$ set $$$a[i] := a[i] + c$$$ and then set $$$b[i] := \max(b[i], a[i])$$$

2. For each $$$i$$$ such, that $$$l \leq i \leq r$$$ set $$$a[i] := \max(a[i], d)$$$ and then set $$$b[i] := \max(b[i], a[i])$$$

3. Print $$$\max(b[l], b[l + 1], ..., b[r])$$$

Input

The first line of the input contains a integers $$$n, q$$$ ($$$1 \leq n,q \leq 5 \cdot 10^5$$$).

The following $$$q$$$ lines of the input start with $$$1 \leq t_i \leq 3$$$ indicating query / update type.

If $$$t_i = 1$$$ the line contains integers $$$l_i, r_i, c_i$$$, ($$$1 \leq l_i \leq r_i \leq n, |c_i| \leq 10^6$$$).

If $$$t_i = 2$$$ the line contains integers $$$l_i, r_i, d_i$$$, ($$$1 \leq l_i \leq r_i \leq n, |d_i| \leq 10^{12}$$$).

If $$$t_i = 3$$$ the line contains integers $$$l_i, r_i$$$, ($$$1 \leq l_i \leq r_i \leq n$$$).

Output

The $$$i$$$-th line of the output should contain the answer to the $$$i$$$-th type 3 query.

Example
Input
10 8
1 1 10 1
1 1 2 2
3 1 7
1 1 5 -100
3 1 3
2 1 6 100
3 7 8
3 6 9
Output
3
3
1
100