P21276 [CodeChef] ANDMIN
提高+
题目描述

Read problems statements in Mandarin Chinese, Russian and Vietnamese as well.

You are given an array of N integers. You should support the following queries on this array.

0 L R : Find the minimum integer in the range A_{L}, A_{L+1}, ..., A_{R}.
1 L R X : You should apply the assignment A[i] = A[i] & X, for all indices i in range [L, R], where & denotes bitwise AND operation.

------ Input ------

First line of the input contains two space separated integers N and Q.
Second line contains N integer numbers denoting array A.
In the next Q lines, each contain one of the queries described above.

------ Output ------

For each query of the type 0, output a single line containing the answer of the query.

------ Constraints ------

$1 ≤ N, Q ≤ 10^{5}$
$1 ≤ A_{i}, X ≤ 10^{9}$
$1 ≤ L ≤ R ≤ N $

------ Example ------

Input:
5 5
1 5 2 3 4
0 2 5
1 1 5 6
0 2 2
1 2 5 3
0 1 3

Output:
2
4
0

输入格式

见题面

输出格式

见题面

样例输入
5 5 1 5 2 3 4 0 2 5 1 1 5 6 0 2 2 1 2 5 3 0 1 3
样例输出
2 4 0