def main(): import sys input = sys.stdin.read data = input().strip().split() N = int(data[0]) Q = int(data[1]) array = list(map(int, data[2:N+2])) queries = data[N+2:] add_value = 0 result = [] query_index = 0 while query_index < len(queries): query_type = int(queries[query_index]) if query_type == 1: # クエリ1: 全ての要素にXを加える X = int(queries[query_index + 1]) add_value += X query_index += 2 elif query_type == 2: # クエリ2: A_iの値を出力する i = int(queries[query_index + 1]) - 1 result.append(array[i] + add_value) query_index += 2 # 結果を出力 print("\n".join(map(str, result))) if __name__ == "__main__": main()