#include <bits/stdc++.h>

#define ll long long
#define loop(i, a, b) for (ll i = a; i < b; i++)

using namespace std;

void get_max_lex(vector<ll> &array, ll index = 0)
{
    if (index == array.size() - 1)
        return;

    ll k0 = array[index];

    // TODO: Optimizuj ovo na ST i RUQ za O(NQlogN)
    loop(i, index + 1, array.size())
    {
        if ((array[index] | array[i]) == array[index])
            continue;
        array[index] |= array[i];
        array[i] &= k0;
    }

    return get_max_lex(array, index + 1);
}

void copy_arr(const vector<ll> &src, vector<ll> &out)
{
    loop(i, 0, src.size())
    {
        out[i] = src[i];
    }
}

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

    ll n, q, t, k, x;
    bool changed = true;
    cin >> n;
    vector<ll> a(n);
    vector<ll> out(n);
    loop(i, 0, n)
    {
        cin >> a[i];
    }
    cin >> q;
    loop(i, 0, q)
    {
        cin >> t >> k;
        k--;
        if (t == 1)
        {
            cin >> x;
            a[k] = x;
            changed = true;
        } else {
            if (changed) {
                copy_arr(a, out);
                get_max_lex(out);
                changed = false;
            }

            cout << out[k] << '\n';
        }

    }




    return 0;
}