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.*;
import java.util.*;

public class Main {
	FastReader scn;
	PrintWriter out;
	String INPUT = "";

	void solve() {
		int n = scn.nextInt(), q = scn.nextInt();
		long[][] arr = new long[n][2];
		for (int i = 0; i < n; i++) {
			arr[i][0] = scn.nextLong();
			arr[i][1] = i;
		}
		int blockSize = (int) Math.ceil(Math.sqrt(n));
		long[] add = new long[n / blockSize + (n % blockSize != 0 ? 1 : 0)];
		sort(arr, blockSize);

		while (q-- > 0) {
			int type = scn.nextInt();
			if (type == 1) {
				int l = scn.nextInt() - 1, r = scn.nextInt() - 1, x = scn.nextInt();
				int bl = (l / blockSize) * blockSize;
				for (int i = bl; i < Math.min(n, bl + blockSize); i++) {
					if (arr[i][1] <= r && arr[i][1] >= l) {
						arr[i][0] += x;
					}
					arr[i][0] += add[bl / blockSize];
				}
				add[bl / blockSize] = 0;
				Arrays.sort(arr, bl, Math.min(arr.length, bl + blockSize),
						(o1, o2) -> o1[0] > o2[0] ? 1 : o1[0] < o2[0] ? -1 : (int) (o1[1] - o2[1]));
				int br = (r / blockSize) * blockSize;
				if(bl == br) {
					continue;
				}
				for (int i = br; i < Math.min(n, br + blockSize); i++) {
					if (arr[i][1] <= r && arr[i][1] >= l) {
						arr[i][0] += x;
					}
					arr[i][0] += add[br / blockSize];
				}
				add[br / blockSize] = 0;
				Arrays.sort(arr, br, Math.min(arr.length, br + blockSize),
						(o1, o2) -> o1[0] > o2[0] ? 1 : o1[0] < o2[0] ? -1 : (int) (o1[1] - o2[1]));

				for (int i = bl / blockSize + 1; i < br / blockSize; i++) {
					add[i] += x;
				}
			} else {
				long y = scn.nextLong();
				long max = -1, min = n + 1, ind = -1;
				for (int i = 0; i < add.length; i++) {
					long x = y - add[i];
					int l = i * blockSize, r = Math.min(n - 1, l + blockSize - 1);
					long a = minInd(l, r, x, arr);
					if(a != -1) {
						min = Math.min(min, a);
						ind = i;
						break;
					}
				}
				if(min == n + 1) {
					out.println(-1);
					continue;
				}
				for(int i = add.length - 1; i >= ind; i--) {
					long x = y - add[i];
					int l = i * blockSize, r = Math.min(n - 1, l + blockSize - 1);
					long a = maxInd(l, r, x, arr);
					if(a != -1) {
						max = Math.max(min, a);
						break;
					}
				}
				
				out.println(max - min);
			}
		}
	}

	long maxInd(int l, int r, long x, long[][] arr) {
		long rv = -1;
		while(l <= r) {
			int m = (l + r) / 2;
			if(arr[m][0] <= x) {
				l = m + 1;
				if(arr[m][0] == x) {
					rv = arr[m][1];
				}
			} else {
				r = m - 1;
			}
		}
		return rv;
	}
	
	long minInd(int l, int r, long x, long[][] arr) {
		long rv = -1;
		while(l <= r) {
			int m = (l + r) / 2;
			if(arr[m][0] >= x) {
				r = m - 1;
				if(arr[m][0] == x) {
					rv = arr[m][1];
				}
			} else {
				l = m + 1;
			}
		}
		return rv;
	}

	void sort(long[][] arr, int len) {
		int i = 0;
		while (i < arr.length) {
			Arrays.sort(arr, i, Math.min(arr.length, i + len),
					(o1, o2) -> o1[0] > o2[0] ? 1 : o1[0] < o2[0] ? -1 : (int) (o1[1] - o2[1]));
			i += len;
		}
	}

	void run() throws Exception {
		long time = System.currentTimeMillis();
		boolean oj = System.getProperty("ONLINE_JUDGE") != null;
		out = new PrintWriter(System.out);
		scn = new FastReader(oj);
		solve();
		out.flush();
		if (!oj) {
			System.out.println(Arrays.deepToString(new Object[] { System.currentTimeMillis() - time + " ms" }));
		}
	}

	public static void main(String[] args) throws Exception {
		new Main().run();
	}

	class FastReader {
		InputStream is;

		public FastReader(boolean onlineJudge) {
			is = onlineJudge ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		}

		byte[] inbuf = new byte[1024];
		public int lenbuf = 0, ptrbuf = 0;

		int readByte() {
			if (lenbuf == -1)
				throw new InputMismatchException();
			if (ptrbuf >= lenbuf) {
				ptrbuf = 0;
				try {
					lenbuf = is.read(inbuf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return -1;
			}
			return inbuf[ptrbuf++];
		}

		boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}

		int skip() {
			int b;
			while ((b = readByte()) != -1 && isSpaceChar(b))
				;
			return b;
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		char nextChar() {
			return (char) skip();
		}

		String next() {
			int b = skip();
			StringBuilder sb = new StringBuilder();
			while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		String nextLine() {
			int b = skip();
			StringBuilder sb = new StringBuilder();
			while ((!isSpaceChar(b) || b == ' ')) { // when nextLine, (isSpaceChar(b) && b != ' ')
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		char[] next(int n) {
			char[] buf = new char[n];
			int b = skip(), p = 0;
			while (p < n && !(isSpaceChar(b))) {
				buf[p++] = (char) b;
				b = readByte();
			}
			return n == p ? buf : Arrays.copyOf(buf, p);
		}

		int nextInt() {
			int num = 0, b;
			boolean minus = false;
			while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
				;
			if (b == '-') {
				minus = true;
				b = readByte();
			}

			while (true) {
				if (b >= '0' && b <= '9') {
					num = num * 10 + (b - '0');
				} else {
					return minus ? -num : num;
				}
				b = readByte();
			}
		}

		long nextLong() {
			long num = 0;
			int b;
			boolean minus = false;
			while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
				;
			if (b == '-') {
				minus = true;
				b = readByte();
			}

			while (true) {
				if (b >= '0' && b <= '9') {
					num = num * 10 + (b - '0');
				} else {
					return minus ? -num : num;
				}
				b = readByte();
			}
		}

		char[][] nextMatrix(int n, int m) {
			char[][] map = new char[n][];
			for (int i = 0; i < n; i++)
				map[i] = next(m);
			return map;
		}

		int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		long[] nextLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		int[][] next2DInt(int n, int m) {
			int[][] arr = new int[n][];
			for (int i = 0; i < n; i++) {
				arr[i] = nextIntArray(m);
			}
			return arr;
		}

		long[][] next2DLong(int n, int m) {
			long[][] arr = new long[n][];
			for (int i = 0; i < n; i++) {
				arr[i] = nextLongArray(m);
			}
			return arr;
		}

		int[] shuffle(int[] arr) {
			Random r = new Random();
			for (int i = 1, j; i < arr.length; i++) {
				j = r.nextInt(i);
				arr[i] = arr[i] ^ arr[j];
				arr[j] = arr[i] ^ arr[j];
				arr[i] = arr[i] ^ arr[j];
			}
			return arr;
		}
	}
}