// Arup Guha
// 3/3/2026
// Solution to Kattis Problem: Fenwick, illustrates use of BIT for COP 4516
// https://open.kattis.com/problems/fenwick

import java.util.*;
import java.io.*;

public class fenwick {

	public static void main(String[] args) throws Exception {

		// Get size and # of queries.
		BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer tok = new StringTokenizer(stdin.readLine());
		int n = Integer.parseInt(tok.nextToken());
		int q = Integer.parseInt(tok.nextToken());
		
		// Set it up I always add a bit of extra space.
		bit mine = new bit(n+2);
		
		// Store answers here.
		StringBuffer sb = new StringBuffer();
		
		// Process Queries.
		for (int i=0; i<q; i++) {
			
			// Get op.
			tok = new StringTokenizer(stdin.readLine());	
			char op = tok.nextToken().charAt(0);
			
			// Add.
			if (op == '+') {
				int idx = Integer.parseInt(tok.nextToken());
				long v = Long.parseLong(tok.nextToken());
				mine.add(idx+1,v);
			}
			
			// Query.
			else {
				int idx = Integer.parseInt(tok.nextToken());
				sb.append(mine.query(idx)+"\n");
			}
		}
		
		// Ta da!
		System.out.print(sb);
	}
}

class bit {

	public int n;
	public long[] sum;
	
	public bit(int myn) {
	
		// Make it big enough.
		n = 1;
		while (n<myn+5) n = (n<<1);
		
		// Java initializes to 0.
		sum = new long[n];
	}
	
	// Adds value to index idx.
	public void add(int idx, long value) {
		
		// We go up in the tree in indexes.
		while (idx < n) {
			
			// Add to this index.
			sum[idx] += value;
			
			// Update by adding lowest one bit to get to next one we have to update.
			idx += (idx&(-idx));
		}
	}
	
	// Returns sum from index 1 to index idx.
	public long query(int idx) {
		long res = 0;
		
		// Add in each location that matters.
		while (idx > 0) {
			
			// Add this one in.
			res += sum[idx];
			
			// We get to the next location by subtracting out the lowest one bit.
			idx -= (idx&(-idx));
		}
		return res;
	}

}