#include <bits/stdc++.h>
using namespace std;
int i, j;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int a;
  long long int v[n];
  vector<long long int> ind;
  for (i = 0; i <= n - 1; ++i) {
    cin >> a;
    v[i] = a;
    if (a == 0) ind.push_back(i);
  }
  int prev = 0;
  for (i = 0; i <= int(ind.size()) - 1; ++i) {
    vector<long long int> temp(v + prev, v + ind[i]);
    sort(temp.begin(), temp.end(), greater<int>());
    int k = min(3, (int)temp.size());
    bool st = 0, qu = 0, ve = 0;
    for (j = prev; j <= ind[i] - 1; ++j) {
      if (v[j] == temp[0] && st == 0) {
        cout << "pushStack\n";
        st = 1;
      } else if (v[j] == temp[1] && qu == 0) {
        cout << "pushQueue\n";
        qu = 1;
      } else if (v[j] == temp[2] && ve == 0) {
        cout << "pushFront\n";
        ve = 1;
      } else
        cout << "pushBack\n";
    }
    if (temp.size() == 0)
      cout << "0\n";
    else if (temp.size() == 1)
      cout << "1 popStack\n";
    else if (temp.size() == 2)
      cout << "2 popStack popQueue\n";
    else
      cout << "3 popStack popQueue popFront\n";
    prev = ind[i] + 1;
  }
  for (i = prev; i <= n - 1; ++i) cout << "pushBack\n";
}
