#include <iostream>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin >> n;
    int a[n];
    int x = 0;
    for(int i = 0; i < n; i++)
    {
        cin >> a[i];
        if(a[i] == 1)
        {
            x++;
        }
    }
    int q;
    cin >> q;
    for(int i = 0; i<q;i++)
    {
        int t, k, y;
        cin >> t >> k ;
        if(t == 1){
            cin >> y;
            x += (y-a[k]);
        }

        else if(t == 0)
        {
            if(k <= x)
            {
                cout << 1 << endl;
            }
            else
            {
                cout << 0 << endl;
            }
        }
    }

    return 0;
}