#include <bits/stdc++.h>
using namespace std;
string push[] = {"pushStack", "pushQueue", "pushFront", "pushBack"};
string pop[] = {"popStack", "popQueue", "popFront"};
int main() {
  int n;
  scanf("%d", &n);
  vector<int> v;
  for (int i = 0; i < n; ++i) {
    int a;
    scanf("%d", &a);
    if (a > 0) {
      v.push_back(a);
      continue;
    }
    vector<int> t = v;
    sort(t.rbegin(), t.rend());
    if (t.size() > 3) t.erase(t.begin() + 3, t.end());
    int j = 0;
    for (int x : v) {
      if (t.size() > 0 && find(t.begin(), t.end(), x) != t.end()) {
        t.erase(find(t.begin(), t.end(), x));
        puts(push[j].c_str());
        ++j;
      } else {
        puts(push[3].c_str());
      }
    }
    printf("%d", j);
    for (int k = 0; k < j; ++k) {
      putchar(' ');
      printf("%s", pop[k].c_str());
    }
    putchar('\n');
    v.clear();
  }
  for (int i = 0; i < (int)v.size(); ++i) {
    puts(push[3].c_str());
  }
  return 0;
}
