#include <bits/stdc++.h>
struct Entry {
  int val;
  int con;
  int ind;
  Entry() : val(-1), ind(-1), con(3) {}
  bool operator<(const Entry& e) const { return val < e.val; }
};
const char* add[] = {"pushStack", "pushQueue", "pushFront", "pushBack"};
const char* pop[] = {"popStack", "popQueue", "popFront", "popBack"};
Entry arr[100000];
std::priority_queue<Entry> pq;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i].val);
    arr[i].ind = i;
    if (arr[i].val == 0) {
      for (int c = 0; c < 3 && !pq.empty(); c++) {
        arr[pq.top().ind].con = c;
        pq.pop();
      }
      pq = std::priority_queue<Entry>();
    } else {
      pq.push(arr[i]);
    }
  }
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (arr[i].val == 0) {
      int r = std::min(3, cnt);
      printf("%d", r);
      for (int c = 0; c < r; c++) {
        printf(" %s", pop[c]);
      }
      printf("\n");
      cnt = 0;
    } else {
      printf("%s\n", add[arr[i].con]);
      cnt++;
    }
  }
  return 0;
}
