#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> A;
  int first, second, third;
  first = second = third = 0;
  vector<string> S{"pushStack", "pushQueue", "pushFront"};
  while (n--) {
    int a;
    cin >> a;
    if (a == 0) {
      if (A.size() == 0)
        cout << "0\n";
      else if (A.size() == 1)
        cout << "pushStack\n1 popStack\n";
      else if (A.size() == 2)
        cout << "pushStack\npushQueue\n2 popStack popQueue\n";
      else {
        int k = 0;
        for (int i = 0; i < A.size(); ++i) {
          if (A[i] == first || A[i] == second || A[i] == third) {
            cout << S[k++] << '\n';
            if (A[i] == first) {
              first = 0;
              continue;
            }
            if (A[i] == second) {
              second = 0;
              continue;
            }
            if (A[i] == third) {
              third = 0;
              continue;
            }
          } else
            cout << "pushBack\n";
        }
        cout << "3 popStack popQueue popFront\n";
      }
      A.clear();
      first = second = third = 0;
    } else {
      A.push_back(a);
      if (a > first) {
        third = second;
        second = first;
        first = a;
      } else if (a > second) {
        third = second;
        second = a;
      } else if (a > third)
        third = a;
    }
  }
  for (int i = 0; i < A.size(); ++i) cout << "pushBack\n";
  return 0;
}
