#include <bits/stdc++.h>
using namespace std;
bool cmp(const pair<int, int> a, const pair<int, int> b) {
  return a.first > b.first;
}
vector<int> zero_pos;
int a[100010];
int main() {
  int n;
  scanf("%d", &n);
  zero_pos.push_back(0);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] == 0) zero_pos.push_back(i);
  }
  for (int i = 1; i < zero_pos.size(); i++) {
    int l = zero_pos[i - 1], r = zero_pos[i];
    vector<pair<int, int> > num;
    num.clear();
    for (int j = l + 1; j < r; j++) num.push_back(make_pair(a[j], j));
    sort(num.begin(), num.end(), cmp);
    if (num.size() == 0) {
      printf("0\n");
    } else if (num.size() == 1) {
      printf("pushStack\n1 popStack\n");
    } else if (num.size() == 2) {
      printf("pushStack\npushQueue\n2 popStack popQueue\n");
    } else {
      vector<int> p;
      for (int j = 0; j < 3; j++) {
        p.push_back(num[j].second);
      }
      sort(p.begin(), p.end());
      for (int j = l + 1; j <= p[0]; j++) printf("pushStack\n");
      for (int j = p[0] + 1; j < p[1]; j++) printf("pushBack\n");
      for (int j = p[1]; j < p[2]; j++) printf("pushQueue\n");
      printf("pushFront\n");
      for (int j = p[2] + 1; j < r; j++) printf("pushBack\n");
      printf("3 popStack popQueue popFront\n");
    }
  }
  for (int i = zero_pos[zero_pos.size() - 1] + 1; i <= n; i++)
    printf("pushStack\n");
  return 0;
}
