#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[1000100], b[1000100];
struct ST {
  int t[2 * 1000100];
  ST() { memset(t, 0, sizeof(t)); }
  int query(int l, int r) {
    int ans = 0;
    for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
      if (l & 1) ans += t[l++];
      if (r & 1) ans += t[--r];
    }
    return ans;
  }
  void update(int p, int v) {
    for (t[p += n] = v; p >>= 1;) t[p] = t[p << 1] + t[p << 1 | 1];
  }
};
ST st;
void hit() {
  int cant = st.query(0, n);
  int lo, hi;
  for (int i = 0; i < m; ++i) {
    int p = a[i];
    if (p > cant) return;
    lo = -1, hi = n;
    while (hi - lo > 1) {
      int mid = (lo + hi) >> 1;
      int res = st.query(0, mid + 1);
      if (res >= p)
        hi = mid;
      else
        lo = mid;
    }
    st.update(hi, 0);
    cant--;
  }
}
int main() {
  int q;
  scanf("%d %d", &q, &m);
  n = 1000000;
  for (int i = int(0); i < int(m); ++i) {
    scanf("%d", a + i);
    a[i] -= i;
  }
  int x, p = 0;
  for (int i = int(0); i < int(q); ++i) {
    scanf("%d", &x);
    if (x == -1)
      hit();
    else {
      b[p] = x;
      st.update(p, 1);
      p++;
    }
  }
  int cant = st.query(0, n);
  char cad[1000100];
  if (!cant)
    printf("Poor stack!\n");
  else {
    int c = 0;
    for (int i = int(0); i < int(p); ++i)
      if (st.t[i + n] != 0) cad[c++] = char(b[i] + '0');
    cad[c++] = '\0';
    printf("%s\n", cad);
  }
  return 0;
}
