Problem: Professor GukiZ was playing with arrays again and accidentally discovered new function, which he called GukiZiana. For given array a, indexed with integers from 1 to n, and number y, GukiZiana(a, y) represents maximum value of j - i, such that aj = ai = y. If there is no y as an element in a, then GukiZiana(a, y) is equal to  - 1. GukiZ also prepared a problem for you. This time, you have two types of queries: 

  1. First type has form 1 l r x and asks you to increase values of all ai such that l ≤ i ≤ r by the non-negative integer x. 
  2. Second type has form 2 y and asks you to find value of GukiZiana(a, y). 



For each query of type 2, print the answer and make GukiZ happy!

Input

The first line contains two integers n, q (1 ≤ n ≤ 5 * 105, 1 ≤ q ≤ 5 * 104), size of array a, and the number of queries. 

The second line contains n integers a1, a2, ... an (1 ≤ ai ≤ 109), forming an array a. 

Each of next q lines contain either four or two numbers, as described in statement:

If line starts with 1, then the query looks like 1 l r x (1 ≤ l ≤ r ≤ n, 0 ≤ x ≤ 109), first type query.

If line starts with 2, then th query looks like 2 y (1 ≤ y ≤ 109), second type query.

Output

For each query of type 2, print the value of GukiZiana(a, y), for y value for that query.

Examples

Input

4 3
1 2 3 4
1 1 2 1
1 1 1 1
2 3


Output

2


Input

2 3
1 2
1 2 2 1
2 3
2 4


Output

0
-1

Solution (in JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.io.Closeable;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "", 1 << 27);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            TaskE solver = new TaskE();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class TaskE {
        public void solve(int testNumber, FastInput in, FastOutput out) {
            int n = in.readInt();
            int q = in.readInt();
            int[] data = new int[n];
            int[] indexes = new int[n];
            int[] buf = indexes.clone();
            for (int i = 0; i < n; i++) {
                data[i] = in.readInt();
                indexes[i] = i;
            }
            int B = Math.max(1, (int) Math.ceil(Math.sqrt(n * Math.log(n) / Math.log(2))));
            int blockCnt = DigitUtils.ceilDiv(n, B);
            Block[] blocks = new Block[blockCnt];
            for (int i = 0; i < blockCnt; i++) {
                blocks[i] = new Block(data, indexes, buf, i * B, Math.min(n - 1, (i + 1) * B - 1));
            }

            for (int i = 0; i < q; i++) {
                int t = in.readInt();
                if (t == 1) {
                    int l = in.readInt() - 1;
                    int r = in.readInt() - 1;
                    int x = in.readInt();
                    for (Block b : blocks) {
                        b.update(l, r, x);
                    }
                } else {
                    int y = in.readInt();
                    int left = -1;
                    int right = -2;
                    for (int j = 0; j < blockCnt; j++) {
                        if (blocks[j].queryLeft(y)) {
                            left = blocks[j].queryLeftBF(y);
                            break;
                        }
                    }

                    for (int j = blockCnt - 1; j >= 0; j--) {
                        if (blocks[j].queryRight(y)) {
                            right = blocks[j].queryRightBF(y);
                            break;
                        }
                    }

                    out.println(right - left);
                }
            }
        }

    }

    static class DigitUtils {
        private DigitUtils() {
        }

        public static int floorDiv(int a, int b) {
            return a < 0 ? -ceilDiv(-a, b) : a / b;
        }

        public static int ceilDiv(int a, int b) {
            if (a < 0) {
                return -floorDiv(-a, b);
            }
            int c = a / b;
            if (c * b < a) {
                return c + 1;
            }
            return c;
        }

    }

    static class Block {
        int[] data;
        int[] indexes;
        int[] buf;
        int l;
        int r;
        long tag = 0;
        static int inf = (int) (1e9 + 10);

        public Block(int[] data, int[] indexes, int[] buf, int l, int r) {
            this.data = data;
            this.indexes = indexes;
            this.buf = buf;
            this.l = l;
            this.r = r;
            CompareUtils.radixSort(indexes, l, r, k -> data[k]);
        }

        public void update(int ll, int rr, int x) {
            ll = Math.max(l, ll);
            rr = Math.min(r, rr);
            if (ll == l && rr == r) {
                tag = Math.min(inf, tag + x);
                return;
            }
            if (ll > rr) {
                return;
            }
            for (int i = ll; i <= rr; i++) {
                data[i] = Math.min(inf, data[i] + x);
            }

            CompareUtils.radixSort(indexes, l, r, k -> data[k]);
        }

        public boolean queryLeft(int x) {
            x -= tag;
            final int finalX = x;
            int left = SequenceUtils.upperBound(indexes, l, r, i -> Integer.compare(data[i], finalX));
            return left <= r && data[indexes[left]] == x;
        }

        public int queryLeftBF(long x) {
            int ans = -1;
            x -= tag;
            for (int i = l; i <= r; i++) {
                if (data[i] == x) {
                    ans = i;
                    break;
                }
            }
            return ans;
        }

        public int queryRightBF(long x) {
            int ans = -1;
            x -= tag;
            for (int i = r; i >= l; i--) {
                if (data[i] == x) {
                    ans = i;
                    break;
                }
            }
            return ans;
        }

        public boolean queryRight(int x) {
            x -= tag;
            final int finalX = x;
            int right = SequenceUtils.lowerBound(indexes, l, r, i -> Integer.compare(data[i], finalX));
            return right >= l && data[indexes[right]] == x;
        }

        public String toString() {
            int[] copy = Arrays.copyOfRange(data, l, r + 1);
            for (int i = 0; i < copy.length; i++) {
                copy[i] += tag;
            }
            return Arrays.toString(copy);
        }

    }

    static class FastInput {
        private final InputStream is;
        private byte[] buf = new byte[1 << 20];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastInput(InputStream is) {
            this.is = is;
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public int readInt() {
            int sign = 1;

            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+' ? 1 : -1;
                next = read();
            }

            int val = 0;
            if (sign == 1) {
                while (next >= '0' && next <= '9') {
                    val = val * 10 + next - '0';
                    next = read();
                }
            } else {
                while (next >= '0' && next <= '9') {
                    val = val * 10 - next + '0';
                    next = read();
                }
            }

            return val;
        }

    }

    static class IntegerList implements Cloneable {
        private int size;
        private int cap;
        private int[] data;
        private static final int[] EMPTY = new int[0];

        public int[] getData() {
            return data;
        }

        public IntegerList(int cap) {
            this.cap = cap;
            if (cap == 0) {
                data = EMPTY;
            } else {
                data = new int[cap];
            }
        }

        public IntegerList(IntegerList list) {
            this.size = list.size;
            this.cap = list.cap;
            this.data = Arrays.copyOf(list.data, size);
        }

        public IntegerList() {
            this(0);
        }

        public void ensureSpace(int req) {
            if (req > cap) {
                while (cap < req) {
                    cap = Math.max(cap + 10, 2 * cap);
                }
                data = Arrays.copyOf(data, cap);
            }
        }

        public void addAll(int[] x, int offset, int len) {
            ensureSpace(size + len);
            System.arraycopy(x, offset, data, size, len);
            size += len;
        }

        public void addAll(IntegerList list) {
            addAll(list.data, 0, list.size);
        }

        public int[] toArray() {
            return Arrays.copyOf(data, size);
        }

        public void clear() {
            size = 0;
        }

        public String toString() {
            return Arrays.toString(toArray());
        }

        public boolean equals(Object obj) {
            if (!(obj instanceof IntegerList)) {
                return false;
            }
            IntegerList other = (IntegerList) obj;
            return SequenceUtils.equal(data, 0, size - 1, other.data, 0, other.size - 1);
        }

        public int hashCode() {
            int h = 1;
            for (int i = 0; i < size; i++) {
                h = h * 31 + Integer.hashCode(data[i]);
            }
            return h;
        }

        public IntegerList clone() {
            IntegerList ans = new IntegerList();
            ans.addAll(this);
            return ans;
        }

    }

    static class CompareUtils {
        private static final int[] BUF8 = new int[1 << 8];
        private static final IntegerList INT_LIST_A = new IntegerList();
        private static final IntegerList INT_LIST_B = new IntegerList();

        private CompareUtils() {
        }

        public static void radixSort(int[] data, int l, int r, IntToIntFunction func) {
            int n = r - l + 1;
            INT_LIST_A.clear();
            INT_LIST_A.addAll(data, l, n);
            INT_LIST_B.clear();
            INT_LIST_B.ensureSpace(n);

            for (int i = 0; i < 4; i += 2) {
                radixSort0(n, INT_LIST_A.getData(), INT_LIST_B.getData(), BUF8, i * 8, func);
                radixSort0(n, INT_LIST_B.getData(), INT_LIST_A.getData(), BUF8, (i + 1) * 8, func);
            }
            System.arraycopy(INT_LIST_A.getData(), 0, data, l, r - l + 1);
        }

        private static void radixSort0(int n, int[] data, int[] output, int[] buf, int rightShift, IntToIntFunction func) {
            Arrays.fill(buf, 0);
            int mask = buf.length - 1;
            for (int i = 0; i < n; i++) {
                buf[(int) ((func.apply(data[i]) >>> rightShift) & mask)]++;
            }
            for (int i = 1; i < buf.length; i++) {
                buf[i] += buf[i - 1];
            }
            for (int i = n - 1; i >= 0; i--) {
                output[--buf[(int) ((func.apply(data[i]) >>> rightShift) & mask)]] = data[i];
            }
        }

    }

    static class SequenceUtils {
        public static int upperBound(int[] data, int l, int r, IntToIntegerFunction f) {
            int excess = r + 1;
            while (l < r) {
                int m = (l + r) >>> 1;
                if (f.apply(data[m]) < 0) {
                    l = m + 1;
                } else {
                    r = m;
                }
            }
            return f.apply(data[l]) >= 0 ? l : excess;
        }

        public static int lowerBound(int[] data, int l, int r, IntToIntegerFunction f) {
            int excess = l - 1;
            while (l < r) {
                int m = (l + r + 1) >>> 1;
                if (f.apply(data[m]) <= 0) {
                    l = m;
                } else {
                    r = m - 1;
                }
            }
            return f.apply(data[l]) <= 0 ? l : excess;
        }

        public static boolean equal(int[] a, int al, int ar, int[] b, int bl, int br) {
            if ((ar - al) != (br - bl)) {
                return false;
            }
            for (int i = al, j = bl; i <= ar; i++, j++) {
                if (a[i] != b[j]) {
                    return false;
                }
            }
            return true;
        }

    }

    static class FastOutput implements AutoCloseable, Closeable, Appendable {
        private StringBuilder cache = new StringBuilder(10 << 20);
        private final Writer os;

        public FastOutput append(CharSequence csq) {
            cache.append(csq);
            return this;
        }

        public FastOutput append(CharSequence csq, int start, int end) {
            cache.append(csq, start, end);
            return this;
        }

        public FastOutput(Writer os) {
            this.os = os;
        }

        public FastOutput(OutputStream os) {
            this(new OutputStreamWriter(os));
        }

        public FastOutput append(char c) {
            cache.append(c);
            return this;
        }

        public FastOutput append(int c) {
            cache.append(c);
            return this;
        }

        public FastOutput println(int c) {
            return append(c).println();
        }

        public FastOutput println() {
            cache.append(System.lineSeparator());
            return this;
        }

        public FastOutput flush() {
            try {
                os.append(cache);
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                os.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }

    static interface IntToIntegerFunction {
        int apply(int x);

    }

    static interface IntToIntFunction {
        int apply(int x);

    }
}