#include <bits/stdc++.h>
using namespace std;
bool sorter(const pair<int, int> &a, const pair<int, int> &b) {
  return a.second > b.second;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<pair<int, int> > arr, sol;
  int i, j;
  int inst;
  int cc;
  for (i = 0; i < n; i++) {
    cin >> inst;
    if (inst > 0)
      arr.push_back(make_pair(i, inst));
    else {
      sort(arr.begin(), arr.end(), sorter);
      for (j = 0; j < arr.size(); j++) {
        if (j == 0)
          sol.push_back(make_pair(arr[j].first, 1));
        else if (j == 1)
          sol.push_back(make_pair(arr[j].first, 2));
        else if (j == 2)
          sol.push_back(make_pair(arr[j].first, 3));
        else
          sol.push_back(make_pair(arr[j].first, 4));
      }
      cc = min(3, j);
      sort(sol.begin(), sol.end());
      for (j = 0; j < sol.size(); j++) {
        if (sol[j].second == 1)
          cout << "pushStack" << '\n';
        else if (sol[j].second == 2)
          cout << "pushQueue" << '\n';
        else if (sol[j].second == 3)
          cout << "pushFront" << '\n';
        else if (sol[j].second == 4)
          cout << "pushBack" << '\n';
      }
      cout << cc;
      if (cc == 1)
        cout << " popStack";
      else if (cc == 2)
        cout << " popStack"
             << " "
             << "popQueue";
      else if (cc == 3)
        cout << " popStack"
             << " "
             << "popQueue"
             << " "
             << "popFront";
      cout << '\n';
      arr.clear();
      sol.clear();
    }
  }
  if (inst == 0)
    return 0;
  else {
    sort(arr.begin(), arr.end(), sorter);
    for (j = 0; j < arr.size(); j++) {
      if (j == 0)
        sol.push_back(make_pair(arr[j].first, 1));
      else if (j == 1)
        sol.push_back(make_pair(arr[j].first, 2));
      else if (j == 2)
        sol.push_back(make_pair(arr[j].first, 3));
      else
        sol.push_back(make_pair(arr[j].first, 4));
    }
    sort(sol.begin(), sol.end());
    for (j = 0; j < sol.size(); j++) {
      if (sol[j].second == 1)
        cout << "pushStack" << '\n';
      else if (sol[j].second == 2)
        cout << "pushQueue" << '\n';
      else if (sol[j].second == 3)
        cout << "pushFront" << '\n';
      else if (sol[j].second == 4)
        cout << "pushBack" << '\n';
    }
  }
  return 0;
}
