#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000001;
int N, M, cur, F, a[maxn], del[maxn];
int c[maxn];
inline int lowbit(int x) { return x & -x; }
inline void add(int x, int d) {
  for (; x < maxn; x += lowbit(x)) {
    c[x] += d;
  }
}
inline int seek(int k) {
  int ans = 0, sum = 0;
  for (int i = 23; i >= 0; i--) {
    ans += 1 << i;
    if (ans > maxn || sum + c[ans] >= k)
      ans -= 1 << i;
    else
      sum += c[ans];
  }
  return ans + 1;
}
int main() {
  scanf("%d%d", &M, &N);
  for (int i = 1; i <= N; ++i) {
    scanf("%d", &del[i]);
  }
  while (M--) {
    int d;
    scanf("%d", &d);
    if (d == -1) {
      int x = upper_bound(del + 1, del + N + 1, cur) - del;
      for (int i = x - 1; i > 0; --i) {
        cur--;
        int t = seek(del[i]);
        add(t, -1);
        a[t] = -1;
      }
    } else {
      cur++;
      add(++F, 1);
      a[F] = d;
    }
  }
  if (cur == 0) {
    printf("Poor stack!\n");
  } else {
    for (int i = 1; i <= cur; ++i) {
      printf("%d", a[seek(i)]);
    }
  }
  return 0;
}
