/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCamldxx dVB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <iostream>
#include <stack>
#include <queue>
#include <string>
using namespace std;
int main()
{
stack<char> s;
queue<char> q;
priority_queue<char> que;
string str;
cin>>str;
int k = 1;
int ans = 0;
char n = '+';
for(char c : str){
if(s.empty()){
cout<<c<<"-\"push\""<<endl;
s.push(c);
}
else if(s.top()-'0'==k){
while(s.top()-'0'!=k){
cout<<s.top()<<"- pop"<< endl;
k++;
s.pop();
}
}
else{
cout<<c<<"-\"push\""<<endl;
s.push(c);
}
}
cout<<s.top()<< "- pop"<<endl;
s.pop();
return 0;
}
LyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgoKV2VsY29tZSB0byBHREIgT25saW5lLgpHREIgb25saW5lIGlzIGFuIG9ubGluZSBjb21waWxlciBhbmQgZGVidWdnZXIgdG9vbCBmb3IgQywgQysrLCBQeXRob24sIEphdmEsIFBIUCwgUnVieSwgUGVybCwKQyMsIE9DYW1sZHh4IGRWQiwgU3dpZnQsIFBhc2NhbCwgRm9ydHJhbiwgSGFza2VsbCwgT2JqZWN0aXZlLUMsIEFzc2VtYmx5LCBIVE1MLCBDU1MsIEpTLCBTUUxpdGUsIFByb2xvZy4KQ29kZSwgQ29tcGlsZSwgUnVuIGFuZCBEZWJ1ZyBvbmxpbmUgZnJvbSBhbnl3aGVyZSBpbiB3b3JsZC4KCioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHN0YWNrPgojaW5jbHVkZSA8cXVldWU+CiNpbmNsdWRlIDxzdHJpbmc+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBtYWluKCkKewogICAgc3RhY2s8Y2hhcj4gczsKICAgIHF1ZXVlPGNoYXI+IHE7CiAgICBwcmlvcml0eV9xdWV1ZTxjaGFyPiBxdWU7CiAgICBzdHJpbmcgc3RyOwogICAgY2luPj5zdHI7CiAgICBpbnQgayA9IDE7CiAgICBpbnQgYW5zID0gMDsKICAgIGNoYXIgbiA9ICcrJzsKICAgIGZvcihjaGFyIGMgOiBzdHIpewogICAgICAgIGlmKHMuZW1wdHkoKSl7CiAgICAgICAgICAgIGNvdXQ8PGM8PCItXCJwdXNoXCIiPDxlbmRsOwogICAgICAgICAgICBzLnB1c2goYyk7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYocy50b3AoKS0nMCc9PWspewogICAgICAgICAgICB3aGlsZShzLnRvcCgpLScwJyE9ayl7CiAgICAgICAgICAgIGNvdXQ8PHMudG9wKCk8PCItIHBvcCI8PCBlbmRsOwogICAgICAgICAgICBrKys7CiAgICAgICAgICAgIHMucG9wKCk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZXsKICAgICAgICAgICAgY291dDw8Yzw8Ii1cInB1c2hcIiI8PGVuZGw7CiAgICAgICAgICAgIHMucHVzaChjKTsKICAgICAgICB9CiAgICB9CiAgICBjb3V0PDxzLnRvcCgpPDwgIi0gcG9wIjw8ZW5kbDsKICAgIHMucG9wKCk7CiAgICByZXR1cm4gMDsKfQ==