#include<stdio.h>
#include<stdlib.h>
#include<string.h>

void addToRange(int *array, int left, int right, int toadd)
{
  for ( ; left <= right; left++ )
    {
      array[left] += toadd;
    }
  return;
}

void printIndex(int *array, int index)
{
  printf("%d\n", array[index]);
  return;
}

int main(){
  size_t length;
  int numberOfQueries, i;
  scanf(" %lu %d", &length, &numberOfQueries);
  int *array = (int *) malloc(sizeof(int[length]));
  memset(array, 0, length);
  // read in queries
  int query;
  for ( i = 0; i < numberOfQueries; i++ )
    {
      scanf(" %d", &query);
      // query is for addition
      if ( !query )
	{
	  int left, right, toadd;
	  scanf(" %d %d %d", &left, &right, &toadd);
	  addToRange(array, left-1, right-1, toadd);
	}
      // query is for a get command
      else
	{
	  int index;
	  scanf(" %d", &index);
	  printIndex(array, index-1);
	}
    }
  free(array);
  return 0;
}

