#include <bits/stdc++.h>
using namespace std;
ifstream fileinp;
bool Mark[1000010];
int T[1000010], A[1000010], B[1000010];
int n, m, p;
void io_set() {
  fileinp.open("test.inp");
  cin.rdbuf(fileinp.rdbuf());
}
void enter() {
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) cin >> A[i];
}
inline void update(int x) {
  while (x <= n) ++T[x], x += x & -x;
}
inline int get(int x) {
  int s = 0;
  while (x) s += T[x], x -= x & -x;
  return s;
}
inline int num(int x) {
  int l = 1, r = p, mid;
  while (l != r) {
    mid = (l + r) >> 1;
    if (x <= mid - get(mid))
      r = mid;
    else
      l = mid + 1;
  }
  return l;
}
void solve() {
  int cur = 0, i, k, t;
  for (i = 1; i <= n; ++i) {
    cin >> k;
    if (k >= 0)
      B[++p] = k, ++cur;
    else {
      k = upper_bound(A + 1, A + m + 1, cur) - A - 1;
      cur -= k;
      for (; k; --k) {
        t = num(A[k]);
        Mark[t] = true;
        update(t);
      }
    }
  }
  t = 1;
  for (i = 1; i <= p; ++i)
    if (!Mark[i]) cout << B[i], t = 0;
  if (t) cout << "Poor stack!";
}
int main() {
  iostream::sync_with_stdio(false);
  enter();
  solve();
  return 0;
}
