#include <bits/stdc++.h>
using namespace std;
int use[100010];
priority_queue<pair<int, int> > q;
int ope[100010];
char s[20][20] = {"pushStack", "pushQueue", "pushFront"};
char s2[20][20] = {"popStack", "popQueue", "popFront"};
int main() {
  int n;
  scanf("%d", &n);
  int now = 0;
  int pre = 0, cnt = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &ope[i]);
    if (ope[i] != 0)
      q.push(make_pair(ope[i], i));
    else {
      int tot = 0;
      cnt++;
      while (!q.empty() && tot < 3) {
        use[q.top().second] = cnt;
        q.pop();
        tot++;
      }
      while (!q.empty()) q.pop();
      int now = 0;
      for (int j = pre; j < i; j++) {
        if (use[j] != cnt)
          puts("pushBack");
        else {
          puts(s[now]);
          now++;
        }
      }
      printf("%d", now);
      for (int j = now - 1; j >= 0; j--) printf(" %s", s2[j]);
      puts("");
      pre = i + 1;
    }
  }
  for (int j = pre; j < n; j++) puts("pushBack");
  return 0;
}
