#include "testlib.h"
#include "constants.h"

int main(int argc, char *argv[]) {
    registerValidation(argc, argv);

    int n = inf.readInt(1, constants::MAX_N, "n");
    inf.readSpace();
    int q = inf.readInt(1, constants::MAX_Q, "q");
    inf.readEoln();

    inf.readInts(n, 1, constants::MAX_X, "a");
    inf.readEoln();

    for (int i = 0; i < q; i++) {
        int l = inf.readInt(1, n, "l");
        inf.readSpace();
        inf.readInt(l, n, "r");
        inf.readSpace();
        inf.readInt(1LL, constants::MAX_S, "S");
        inf.readEoln();
    }

    inf.readEof();
}
