FJ's farm consists of NN fields in a row, conveniently numbered 1…N1…N. In each field there can be any number of haybales. Farmer John's instructions contain three types of entries:
1) Given a contiguous interval of fields, add a new haybale to each field.
2) Given a contiguous interval of fields, determine the minimum number of haybales in a field within that interval.
3) Given a contiguous interval of fields, count the total number of haybales inside that interval.
The first line contains two positive integers, NN (1≤N≤200,0001≤N≤200,000) and QQ (1≤Q≤100,0001≤Q≤100,000).
The next line contains NN nonnegative integers, each at most 100,000, indicating how many haybales are initially in each field.
Each of the next QQ lines contains a single uppercase letter, either M, P or S, followed by either two positive integers AA and BB (1≤A≤B≤N1≤A≤B≤N), or three positive integers AA, BB, and CC (1≤A≤B≤N1≤A≤B≤N; 1≤C≤100,0001≤C≤100,000). There will be three positive integers if and only if the uppercase letter is P.
If the letter is M, print the minimum number of haybales in the interval of fields from A…BA…B.
If the letter is P, put CC new haybales in each field in the interval of fields from A…BA…B.
If the letter is S, print the total number of haybales found within interval of fields from A…BA…B.
A line in the output should appear in response to every 'M' or 'S' entry in FJ's instructions.