#include using namespace std; int main(){ using ll=long long; int n,k,q; cin>>n>>k>>q; priority_queue pq,pq2; vector a(n); for (int i=0;i>a[i]; sort(a.begin(),a.end()); for (int i=0;i>t; if (t==1){ ll x; cin>>x; pq2.push(-x); while (pq.top()>-pq2.top()){ ll top=pq.top(); ll top2=pq2.top(); pq.pop(); pq2.pop(); pq2.push(-top); pq.push(-top2); } } if (t==2){ ll y; cin>>y; ll top=pq.top(); pq.pop(); pq.push(top+y); while (pq.top()>-pq2.top()){ ll top=pq.top(); ll top2=pq2.top(); pq.pop(); pq2.pop(); pq2.push(-top); pq.push(-top2); } //cout<