The first line contains the length of the sequence n (1≤n≤1000) and the number of queries q (1≤q≤10000).
The second line contains the n numbers of the sequence, separated by single spaces. Each number is an integer between −2147483648 and 2147483647, inclusive.
Each of the next q lines contains one query, in the form 1 a b or 2 a b c d. The values a, b, c, d are positive integers not greater than n, and a≤b and c≤d are guaranteed.