#include <bits/stdc++.h>
using namespace std;
set<pair<int, int> > s;
set<pair<int, int> >::iterator it;
int main() {
  int n, a, i, j(1), k;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a;
    if (a == 0) {
      if ((int)s.size() == 0)
        printf("0\n");
      else if ((int)s.size() == 1)
        printf("pushStack\n1 popStack\n");
      else if ((int)s.size() == 2)
        printf("pushStack\npushQueue\n2 popStack popQueue\n");
      else if ((int)s.size() == 3)
        printf(
            "pushStack\npushQueue\npushFront\n3 popStack popQueue popFront\n");
      else {
        it = s.begin();
        int A = it->second;
        it++;
        int B = it->second;
        it++;
        int C = it->second;
        for (k = j; k < i; k++) {
          if (k == A)
            printf("pushStack\n");
          else if (k == B)
            printf("pushQueue\n");
          else if (k == C)
            printf("pushFront\n");
          else
            printf("pushBack\n");
        }
        printf("3 popStack popQueue popFront\n");
      }
      j = i + 1;
      s.clear();
    } else
      s.insert(make_pair(-a, i));
  }
  if (j <= n)
    for (i = j; i <= n; i++) cout << "pushStack\n";
  return 0;
}
