#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);
template <class V, int ME>
class BIT {
 public:
  V bit[1 << ME];
  BIT() {
    for (int i = 0; i < (1 << ME); ++i) bit[i] = 0;
  };
  int lower_bound(V val) {
    V tv = 0;
    int i, ent = 0;
    for (i = 0; i < ME; ++i)
      if (tv + bit[ent + (1 << (ME - 1 - i)) - 1] < val)
        tv += bit[ent + (1 << (ME - 1 - i)) - 1], ent += (1 << (ME - 1 - i));
    return ent;
  }
  V total(int entry) {
    V s = 0;
    entry++;
    while (entry > 0) s += bit[entry - 1], entry -= entry & -entry;
    return s;
  }
  void update(int entry, V val) {
    entry++;
    while (entry <= (1 << ME)) bit[entry - 1] += val, entry += entry & -entry;
  }
};
BIT<int, 20> bt;
int N, M;
int A[1000002], B[1000002];
int NG[1000002];
vector<int> V, D;
void solve() {
  int f, i, j, k, l, x, y, r;
  cin >> N >> M;
  for (i = 0; i < M; ++i) cin >> A[i];
  A[M] = N;
  NG[0] = 1;
  y = 0;
  V.push_back(2);
  for (i = 0; i < N; ++i) bt.update(i + 1, 1);
  for (i = 0; i < N; ++i) {
    cin >> x;
    if (x >= 0)
      V.push_back(x), y++;
    else {
      f = lower_bound(A, A + M, y + 1) - A;
      if (f > 0) {
        D.push_back(f);
        y -= f;
      }
    }
  }
  if (y == 0) {
    cout << "Poor stack!" << endl;
  } else {
    for (i = 0; i < D.size(); ++i) {
      for (f = D[i] - 1; f >= 0; f--) {
        j = bt.lower_bound(A[f]);
        NG[j] = 1;
        bt.update(j, -1);
      }
    }
    for (i = 0; i < V.size(); ++i)
      if (NG[i] == 0) cout << V[i];
    cout << endl;
  }
}
int main() {
  solve();
  return 0;
}
