#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
int n, T;
vector<int> S[100010];
bool vis[100010];
char com[3][16] = {"pushStack", "pushQueue", "pushFront"};
void init() {
  int value, t = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &value);
    S[t].push_back(value);
    if (value == 0) ++t;
  }
  if (S[t].size() != 0)
    T = t + 1;
  else
    T = t;
}
int main() {
  init();
  for (int t = 0; t < T; ++t) {
    if (t == T - 1 && S[t][S[t].size() - 1] != 0) {
      for (int i = 0; i < S[t].size(); ++i) printf("pushStack\n");
      break;
    }
    if (S[t].size() == 1)
      printf("0\n");
    else if (S[t].size() == 2)
      printf("pushStack\n1 popStack\n");
    else if (S[t].size() == 3)
      printf("pushStack\npushQueue\n2 popStack popQueue\n");
    else if (S[t].size() == 4)
      printf("pushStack\npushQueue\npushFront\n3 popStack popQueue popFront\n");
    else {
      int len = S[t].size() - 1;
      memset(vis, 0, sizeof(int) * len);
      for (int k = 0; k < 3; ++k) {
        int maxValue = -1, maxIndex = -1;
        for (int i = 0; i < len; ++i) {
          if (!vis[i] && maxValue < S[t][i]) {
            maxValue = S[t][i];
            maxIndex = i;
          }
        }
        vis[maxIndex] = true;
      }
      int cnt = 0;
      for (int i = 0; i < len; ++i) {
        if (vis[i])
          printf("%s\n", com[cnt++]);
        else
          printf("pushBack\n");
      }
      printf("3 popStack popQueue popFront\n");
    }
  }
  return 0;
}
