#include <bits/stdc++.h>
using namespace std;
const long long logN = 20;
const long long N = 100005;
const long long M = 1000000007;
const long long dx[4] = {1, 0, -1, 0};
const long long dy[4] = {0, 1, 0, -1};
long long A[N];
vector<pair<long long, long long> > v;
long long B[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> A[i];
  for (long long i = 0; i < n; i++) {
    if (A[i] == 0) {
      cout << 0 << "\n";
    } else {
      v.clear();
      long long j = i;
      while (A[i] != 0) v.push_back({A[i], i - j}), i++;
      sort(v.rbegin(), v.rend());
      long long m = v.size();
      bool f = 1;
      for (long long i = 0; i < m; i++) B[i] = 0;
      if (i >= n) f = 0;
      if (m == 1) {
        cout << "pushStack"
             << "\n";
        if (f)
          cout << 1 << " "
               << "popStack"
               << "\n";
      } else if (m == 2) {
        cout << "pushStack"
             << "\n";
        cout << "pushQueue"
             << "\n";
        if (f)
          cout << 2 << " "
               << "popStack"
               << " "
               << "popQueue"
               << "\n";
      } else {
        if (v[0].second > v[1].second) {
          for (long long i = 0; i < v[0].second + 1; i++) B[i] = 0;
          for (long long i = v[1].second; i < m; i++) {
            if (i != v[0].second) B[i] = 1;
          }
        } else {
          for (long long i = 0; i < v[1].second + 1; i++) B[i] = 0;
          for (long long i = v[0].second; i < m; i++) {
            if (i != v[1].second) B[i] = 1;
          }
        }
        B[v[2].second] = 2;
        for (long long i = 0; i < m; i++) {
          if (B[i] == 0)
            cout << "pushStack"
                 << "\n";
          if (B[i] == 1)
            cout << "pushQueue"
                 << "\n";
          if (B[i] == 2)
            cout << "pushFront"
                 << "\n";
        }
        if (f)
          cout << "3 popStack popQueue popFront"
               << "\n";
      }
    }
  }
  return 0;
}
