#include using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll N, M; cin >> N >> M; vector A(M); for(auto &i : A) { cin >> i; } set> S; for(ll i = 0; i < M; i++) { S.insert({A[i], i}); } ll Q; cin >> Q; while(Q--) { ll type, x, y; cin >> type >> x >> y; x--; if(type == 1) { S.erase({A[x], x}); A[x] += y; S.insert({A[x], x}); } else if(type == 2) { S.erase({A[x], x}); A[x] -= y; S.insert({A[x], x}); } else { cout << (*S.rbegin()).second + 1 << "\n"; } } }