#include <bits/stdc++.h>
using namespace std;
const int T = 2000005;
int add[T], prv[T], nxt[T];
int ch[T];
int d[T], fix[T], s[T], a[T];
int l;
void upd(int p, int delta) {
  while (p <= 2000002) {
    s[p] += delta;
    p = nxt[p];
  }
}
int sum(int p) {
  int h = 0;
  while (p) {
    h += s[p];
    p = prv[p];
  }
  return h;
}
int main() {
  for (int i = 0; i <= 2000002; i++) {
    prv[i] = i & (i - 1);
    nxt[i] = 2 * i - prv[i];
  }
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) scanf("%d", &a[i]);
  while (n--) {
    int k;
    scanf("%d", &k);
    if (k == -1) {
      if (!l) continue;
      int num = 0;
      for (int i = 1; i <= m; i++) {
        int lit = 1;
        int rit = l;
        while (lit < rit) {
          int mid = (lit + rit) >> 1;
          if (sum(mid) >= a[i])
            rit = mid;
          else
            lit = mid + 1;
          if (rit == lit + 1)
            if (sum(lit) == a[i])
              rit--;
            else
              lit++;
        }
        if (sum(rit) == a[i])
          add[num++] = rit, fix[rit] = 1;
        else
          break;
      }
      for (int i = 0; i < num; i++) upd(add[i], -1);
      continue;
    }
    ch[++l] = k;
    upd(l, 1);
  }
  bool flag = false;
  for (int i = 1; i <= l; i++)
    if (!fix[i]) {
      printf("%d", ch[i]);
      flag = true;
    }
  if (!flag) cout << "Poor stack!";
  printf("\n");
}
