#include using namespace std; typedef struct StackMember { int nomor, banyak; } member; int main() { vector modstack; int n, isinya = 0; ios_base::sync_with_stdio(false); cin.tie(NULL); cin>>n; while(n--) { string command; cin>>command; if(command == "add") { member tmp; cin>>tmp.nomor>>tmp.banyak; isinya += tmp.banyak; cout<>y; cout< 0) { int elemenakhir = modstack[modstack.size() - 1].banyak; modstack[modstack.size() - 1].banyak -= y; if(modstack[modstack.size() - 1].banyak <= 0) modstack.erase(modstack.end() - 1); y -= elemenakhir; } } } else if(command == "dex") { int x; cin>>x; for(int i=0; i < modstack.size(); i++) modstack[i].nomor -= x; } else { int x; cin>>x; for(int i=0; i < modstack.size(); i++) modstack[i].nomor += x; } } return 0; }