def rangeQuery(n, q, arr, commands):
result = []
for command in commands:
if command[0] == 1:
arr[command[1] - 1] = command[2]
else:
start, end = command[1] - 1, command[2] - 1
min_num = float('inf')
for i in range(start, end + 1):
if arr[i] < min_num:
min_num = arr[i]
result.append(min_num)
# print(min_num)
return result
def main():
# n, q = 8, 4
# arr = [3, 2, 4, 5, 1, 1, 5, 3]
# commands = [[2, 1, 4], [2, 5, 6], [1, 2, 3], [2, 1, 4]]
# result = rangeQuery(n, q, arr, commands)
# print(*result, sep='\n')
n, q = map(int, input().split())
arr = list(map(int, input().split()))
commands = [list(map(int, input().split())) for _ in range(q)]
result = rangeQuery(n, q, arr, commands)
print(*result, sep='\n')
if __name__ == "__main__":
main()