#include <bits/stdc++.h>
using namespace std;
char M[100005][50];
int A[100005];
pair<int, int> B[100005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &A[i]);
  int last = -1;
  for (int i = 0; i < n; i++) {
    if (A[i] == 0) {
      int k = 0;
      for (int j = last + 1; j < i; j++) B[k++] = make_pair(-A[j], j);
      if (k == 0) {
        strcpy(M[i], "0");
      } else {
        sort(B, B + k);
        k = min(k, 3);
        for (int j = 0; j < k; j++) swap(B[j].first, B[j].second);
        sort(B, B + k);
        if (k == 1) {
          strcpy(M[i], "1 popStack");
          for (int j = last + 1; j <= B[0].first; j++)
            strcpy(M[j], "pushStack");
          for (int j = B[0].first + 1; j < i; j++) strcpy(M[j], "pushQueue");
        } else {
          if (k == 2)
            strcpy(M[i], "2 popStack popQueue");
          else
            strcpy(M[i], "3 popStack popQueue popFront");
          for (int j = last + 1; j < B[0].first; j++) strcpy(M[j], "pushStack");
          strcpy(M[B[0].first], "pushQueue");
          for (int j = B[0].first + 1; j < i; j++) strcpy(M[j], "pushQueue");
          if (k > 2) strcpy(M[B[1].first], "pushFront");
          strcpy(M[B[k - 1].first], "pushStack");
        }
      }
      last = i;
    }
  }
  for (int j = last + 1; j < n; j++) strcpy(M[j], "pushQueue");
  for (int i = 0; i < n; i++) printf("%s\n", M[i]);
  return 0;
}
