import sys

def solve(l, r, a, n):
    pass

n, q = map(int, sys.stdin.readline().split())
a = list(map(int, sys.stdin.readline().split()))
pref = [sum(a[0:x]) for x in range(1, n)]
suf = [sum(a[x:n]) for x in range(n-1, -1, -1)]

for _ in range(q):
    q1 = list(map(int, sys.stdin.readline().split()))
    if q1[0] == 1:
        a[q1[1]-1] = -a[q1[1]-1]
    else:
        print(abs(q1[1]-q1[2]))
