#include <bits/stdc++.h>
using namespace std;
const int size = 2000007;
const long long modulo = 1000000007;
const int INF = 2e9;
const double EPS = 1e-10;
string s[3] = {"popStack", "popQueue", "popFront"};
string ss[3] = {"pushStack", "pushQueue", "pushFront"};
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > a(n + 1);
  for (int i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  a[n] = make_pair(0, n);
  vector<string> ans(n + 1);
  int prev = -1;
  for (int i = 0; i < n;) {
    int ind = i;
    while (ind <= n && a[ind].first > 0) ++ind;
    sort(a.begin() + i, a.begin() + ind);
    for (int j = i; j < ind - 3; j++) ans[a[j].second] = "pushBack";
    for (int j = ind - 1; j > ind - 4 && j >= i; j--)
      ans[a[j].second] = ss[ind - 1 - j];
    int k = min(3, ind - i);
    string str = string(1, char(k + '0'));
    if (ind < n) {
      for (int j = 0; j < k; j++) str += " " + s[j];
    }
    ans[ind] = str;
    i = ind + 1;
  }
  for (int i = 0; i < n; i++) cout << ans[i] << endl;
  return 0;
}
