Problem: Nastya likes reading and even spends whole days in a library sometimes. Today she found a chronicle of Byteland in the library, and it stated that there lived shamans long time ago. It is known that at every moment there was exactly one shaman in Byteland, and there were n shamans in total enumerated with integers from 1 to n in the order they lived. Also, each shaman had a magic power which can now be expressed as an integer.

The chronicle includes a list of powers of the n shamans. Also, some shamans can be king-shamans, if they gathered all the power of their predecessors, i.e. their power is exactly the sum of powers of all previous shamans. Nastya is interested in whether there was at least one king-shaman in Byteland.

Unfortunately many of the powers are unreadable in the list, so Nastya is doing the following:

  * Initially she supposes some power for each shaman. 
  * After that she changes the power of some shaman q times (the shamans can differ) and after that wants to check if there is at least one king-shaman in the list. If yes, she wants to know the index of any king-shaman. 



Unfortunately the list is too large and Nastya wants you to help her.

Input

The first line contains two integers n and q (1 ≤ n, q ≤ 2·105).

The second line contains n integers a1, ..., an (0 ≤ ai ≤ 109), where ai is the magic power of the i-th shaman.

After that q lines follow, the i-th of them contains two integers pi and xi (1 ≤ pi ≤ n, 0 ≤ xi ≤ 109) that mean that the new power of the pi-th shaman is xi.

Output

Print q lines, the i-th of them should contain  - 1, if after the i-th change there are no shaman-kings, and otherwise a single integer j, where j is an index of some king-shaman after the i-th change.

If there are multiple king-shamans after each change, print the index of any of them.

Examples

Input

2 1
1 3
1 2


Output

-1


Input

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


Output

3
2
-1
3


Input

10 7
0 3 1 4 6 2 7 8 10 1
2 5
1 3
9 36
4 10
4 9
1 2
1 0


Output

1
-1
9
-1
4
-1
1

Note

In the first example powers of shamans after the first change are equal to (2, 3). The answer equals  - 1, because the sum of powers of shamans before the first shaman is equal to 0, and before the second is equal to 2.

In the second example after the first change the powers are equal to (1, 2, 3). The answer is equal to 3, because the power of the third shaman is equal to 3, and the sum of powers of the first and the second shaman is also 1 + 2 = 3. After the second change the powers become equal to (2, 2, 3), where the answer equals 2. After the third change the powers become equal to (2, 4, 3), where the answer equals  - 1. After the fourth change the powers become equal to (2, 4, 6), where the answer equals 3.

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;

public class E implements Runnable{
	public static void main (String[] args) {new Thread(null, new E(), "_cf", 1 << 28).start();}

	int log;
	
	public void run() {
		FastScanner fs = new FastScanner();
//		try { new TestGenerator(); } catch (Exception e) {}
//		try { fs = new FastScanner("testdata.out"); } catch (Exception e) {}
		PrintWriter out = new PrintWriter(System.out);
		System.err.println("Go!");

		int n = fs.nextInt();
		log = Integer.numberOfTrailingZeros(Integer.highestOneBit(n)*2);
		int q = fs.nextInt();
		int[] a = new int[n+1];
		BIT bit = new BIT(n+1);
		for(int i = 1; i <= n; i++) {
			a[i] = fs.nextInt();
			bit.update(i, a[i]);
		}
		while(q-->0) {
			int p = fs.nextInt();
			int x = fs.nextInt();
			bit.update(p, x - a[p]);
			a[p] = x;
			
			if(a[1] == 0) {
				out.println(1);
				continue;
			}
			
//			out.println("BIT " + Arrays.toString(bit.bit));
//			out.println("Array " + Arrays.toString(a));
			
			long need = a[1];
			int at = 1, res = -1;
			while(need <= (int)1e9) {
				int find = find(2*need-1, bit);
//				out.printf(" %d: %d = %d\n", at, need, find);
				if(find == -1) {
					break;
				}
				need = bit.sum(find-1);
				at = find;
				if(a[find] == need) {
					res = at;
					break;
				}
				need += a[find];
			}
			out.println(res);
//			out.println();
		}
		
		out.close();
	}
	
	//find the earliest position whose prefix sum > x
	int find(long x, BIT bit) {
		int n = bit.n;
		if(bit.sum(n-1) <= x) return -1;
		int at = 0;
		long sum = 0;
		for(int p = log - 1; p >= 0; p--) {
			if(at + (1 << p) >= n) continue;
			long nsum = sum + bit.bit[at + (1 << p)];
			if(nsum <= x) {
				//keep walking
				sum = nsum;
				at += 1 << p;
			}
		}
		return at+1;
	}
	
	class BIT {
		long[] bit;
		int n;
		
		public BIT(int a) {
			n = a + 1;
			bit = new long[n];
		}
		void update (int index, int val) {
			while(index < n) {
				bit[index] += val;
				index += (index & (-index));
			}
		}
		long sum (int index) {
			long sum = 0;
			while(index > 0) {
				sum += bit[index];
				index -= (index & (-index));
			}
			return sum;
		}
	}


	class ST {
		int n;
		int[] a, p;
		ST(int z, int[] b) {
			n = z;
			a = new int[2*n];
			p = new int[2*n];
			init(b);
		}
		void init(int[] b) {
			for(int i = 0; i < n; i++) {
				a[i + n] = b[i];
				p[i + n] = i;
			}
			for(int i = n-1; i >= 0; i--) {
				if(a[i<<1] >= a[i<<1|1]) p[i] = p[i<<1];
				else p[i] = p[i<<1|1];
				a[i] = Math.max(a[i << 1], a[i << 1 | 1]);
			}
		}
		void upd(int x, int v) {
			a[x + n] = v;
			p[x + n] = x;
			for(int i = x + n; i > 1; i >>= 1) {
				if(a[i] >= a[i^1]) p[i>>1] = p[i];
				else p[i>>1] = p[i^1];
				a[i >> 1] = Math.max(a[i], a[i^1]);
			}
		}
		int find(int l, int r, int v) {
			int res = 3*n;
			for(l += n, r += n; l < r; l >>= 1, r >>= 1) {
				System.out.println("L " + l + " R " + r);
				if((l&1) > 0) {
					if(a[l] >= v) res = Math.min(res, p[l++]);
				}
				else {
					if((l^1) < r) {
						if(a[l] >= v) res = Math.min(res, p[l]);
						if(a[l^1] >= v) res = Math.min(res, p[l^1]);
					}
				}
				
				if((r&1) > 0) {
					int nr = r-1;
					if(a[nr] >= v) res = Math.min(res, p[nr]);
					r--;
				}
				else {
				}
			}
			if(res == 3*n) res = -1;
			return res;
		}
	}
	
	class FastScanner {
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public FastScanner() {
			in = new BufferedInputStream(System.in, BS);
		}

		public FastScanner(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}                
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
		
		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for(int i = 0; i < n; i++) res[i] = nextInt();
			return res;
		}
		
	}

}