#include <bits/stdc++.h>

#define maxn 100001

using namespace std;

int n;
int arr[maxn];

void solve() {
	int t, k;
	cin >> t;
	if(t == 1) {
		int x;
		cin >> k >> x;
		arr[k - 1] = x;
	} else {
		cin >> k;
		int suma = 0;
		for(int i = 0; i < n; i++) {
			suma += arr[i];
		}
		if(k > suma) cout << "0\n";
		else cout << "1\n";
	}
}

int main() {
	int q;
	cin >> n;
	for(int i = 0; i < n; i++) cin >> arr[i];
	cin >> q;
	while(q--) solve();
	return 0;
}