#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const long long M = 1e9 + 7;
long long pwr(long long a, long long x) {
  long long r = 1;
  while (x > 0) {
    if (x & 1) r = r * a;
    a = a * a;
    x /= 2;
  }
  return r;
}
long long axm(long long a, long long x, long long m) {
  a %= m;
  long long r = 1;
  while (x > 0) {
    if (x & 1) r = r * a % m;
    a = a * a % m;
    x /= 2;
  }
  return r;
}
long long inv(long long a, long long m) { return axm(a, m - 2, m); }
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  ;
  long long n, x;
  cin >> n;
  vector<long long> a;
  while (n--) {
    cin >> x;
    if (x != 0)
      a.push_back(x);
    else {
      long long i1 = -1, i2 = -1, i3 = -1, sz = a.size();
      vector<pair<long long, long long> > b;
      for (long long i = 0; i < sz; i++) b.push_back(make_pair(a[i], i));
      sort((b).begin(), (b).end());
      if (sz >= 1) i1 = b[sz - 1].second;
      if (sz >= 2) i2 = b[sz - 2].second;
      if (sz >= 3) i3 = b[sz - 3].second;
      long long c = 0;
      for (long long i = 0; i < sz; i++) {
        if (i == i1) {
          c++;
          cout << "pushStack";
        } else if (i == i2) {
          c++;
          cout << "pushQueue";
        } else if (i == i3) {
          c++;
          cout << "pushFront";
        } else
          cout << "pushBack";
        cout << "\n";
      }
      if (c == 0)
        cout << 0;
      else
        cout << c << " ";
      if (c == 1) cout << "popStack";
      if (c == 2) cout << "popStack popQueue";
      if (c == 3) cout << "popStack popQueue popFront";
      cout << "\n";
      a.clear();
    }
  }
  for (long long i = 0; i < a.size(); i++) cout << "pushBack\n";
  return 0;
}
