#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxm = 1e6 + 10;
int tree[4 * maxm], add[4 * maxm], ch[maxm], ans[maxm];
void pushup(int rt) { tree[rt] = tree[rt << 1] + tree[rt << 1 | 1]; }
void update(int L, int C, int l, int r, int rt) {
  if (l == r) {
    tree[rt] = 1;
    ans[l] = C;
    return;
  }
  int m = (l + r) >> 1;
  if (L <= m)
    update(L, C, l, m, rt << 1);
  else
    update(L, C, m + 1, r, rt << 1 | 1);
  pushup(rt);
}
void remove(int pos, int l, int r, int rt) {
  if (l == r) {
    tree[rt] = 0;
    return;
  }
  int m = (l + r) >> 1;
  if (pos <= tree[rt << 1])
    remove(pos, l, m, rt << 1);
  else
    remove(pos - tree[rt << 1], m + 1, r, rt << 1 | 1);
  pushup(rt);
}
void output(int l, int r, int rt) {
  if (l == r) {
    printf("%d", ans[l]);
    return;
  }
  int m = (l + r) >> 1;
  if (tree[rt << 1]) output(l, m, rt << 1);
  if (tree[rt << 1 | 1]) output(m + 1, r, rt << 1 | 1);
}
int main() {
  int n, m, num = 0;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) scanf("%d", &ch[i]);
  for (int j = 1; j <= n; j++) {
    int op;
    scanf("%d", &op);
    if (op == 0 || op == 1) {
      num++;
      update(num, op, 1, n + 1, 1);
    } else {
      for (int i = 1; i <= m; i++) {
        if (ch[i] - i + 1 <= tree[1]) {
          remove(ch[i] - i + 1, 1, n + 1, 1);
        } else
          break;
      }
    }
  }
  if (tree[1])
    output(1, n + 1, 1);
  else
    puts("Poor stack!");
  return 0;
}
