#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1E9;
int s[1000005];
void add(int k, int v) {
  k++;
  for (; k < 1000005; k += -k & k) s[k] += v;
}
int get(int k) {
  k++;
  int ans = 0;
  for (; k; k -= -k & k) ans += s[k];
  return ans;
}
int findkth(int k) {
  int e = 0, cnt = 0;
  for (int i = 20; i >= 0; i--) {
    int b = 1 << i;
    if (e + b >= 1000005 || cnt + s[e + b] >= k) continue;
    e += b;
    cnt += s[e];
  }
  return e;
}
int N, M, K;
int x[1000005], str[1000005], pre[1000005], nxt[1000005];
int main() {
  cin >> M >> N;
  for (int i = (0); i < (N); i++) {
    scanf("%d", x + i);
  }
  int cnt = 0;
  fill_n(pre, M + 1, -1);
  fill_n(nxt, M + 1, -1);
  while (M--) {
    int op;
    scanf("%d", &op);
    if (op == -1) {
      for (int i = (0); i < (N); i++) {
        if (x[i] - i > cnt) break;
        int e = findkth(x[i] - i);
        add(e, -1);
        cnt--;
        if (nxt[e] != -1) pre[nxt[e]] = pre[e];
        if (pre[e] != -1) nxt[pre[e]] = nxt[e];
      }
    } else {
      str[K] = op;
      if (cnt > 0) {
        int e = findkth(cnt);
        nxt[e] = K;
        pre[K] = e;
      }
      add(K, 1);
      K++;
      cnt++;
    }
  }
  if (cnt == 0)
    puts("Poor stack!");
  else {
    int e = findkth(1);
    while (e != -1) {
      printf("%d", str[e]);
      e = nxt[e];
    }
  }
  return 0;
}
