#include <bits/stdc++.h>
#define INT long long int
using namespace std;
int n, a[20], chk[20];
stack<char> t;
vector<int> ans;
int main()
{
    freopen(".9.in","r",stdin);
    freopen(".9.out","w",stdout);
    cin>>n;
    for(int i = 0 ; i < n ; i++ ) scanf("%1d", &a[i]);
    for(int i = 0, p = 1 ; p <= n ; )
    {
        if( !chk[p] )
        {
            while( a[i] != p )
                chk[a[i]] = 1, t.push(a[i]), ans.push_back(1), i++;
            ans.push_back(1);
            ans.push_back(0);
            i++, p++;
        }
        else
        {
            if( !t.empty() and t.top() == p ) ans.push_back(0), t.pop();
            else return cout<<"-1", 0;
            p++;
        }
    }
    for(int x : ans)
    {
        if( x ) cout<<"push"<<endl;
        else cout<<"pop"<<endl;
    }
}
