#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  void solve(int n) {
    int a;
    vector<pair<int, int>> v;
    map<int, string> pushOp;
    map<int, string> popOp;
    pushOp = {
        {0, "pushStack"}, {1, "pushQueue"}, {2, "pushFront"}, {3, "pushBack"}};
    popOp = {{0, "popStack"}, {1, "popQueue"}, {2, "popFront"}, {3, "popBack"}};
    for (int i = 0; i < n; ++i) {
      cin >> a;
      if (a != 0) {
        v.push_back({a, i});
      } else {
        if (v.empty()) {
          cout << "0" << endl;
          continue;
        }
        sort(v.begin(), v.end());
        reverse(v.begin(), v.end());
        int N = v.size();
        if (N <= 3) {
          for (int k = 0; k < N; ++k) {
            cout << pushOp[k] << endl;
          }
          cout << N << " ";
          for (int k = 0; k < N; ++k) {
            if (k != N - 1) {
              cout << popOp[k] << " ";
            } else {
              cout << popOp[k] << endl;
            }
          }
        } else {
          vector<pair<int, int>> res;
          res.push_back({v[0].second, 2});
          res.push_back({v[1].second, 1});
          res.push_back({v[2].second, 0});
          for (int k = 3; k < N; ++k) {
            res.push_back({v[k].second, 3});
          }
          sort(res.begin(), res.end());
          for (int k = 0; k < N; ++k) {
            cout << pushOp[res[k].second] << endl;
          }
          cout << "3 ";
          for (int k = 0; k < 3; ++k) {
            if (k != 2) {
              cout << popOp[k] << " ";
            } else {
              cout << popOp[k] << endl;
            }
          }
        }
        v.clear();
      }
    }
    if (!v.empty()) {
      int N = v.size();
      for (int k = 0; k < N; ++k) {
        cout << pushOp[1] << endl;
      }
    }
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  Solution solver;
  solver.solve(n);
  return 0;
}
