#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000000;
int m, n, i, j, x, y, sz, f[4000333], cnt, a[1000333], seq[1000333];
void upd(int v, int x) {
  v = v + sz - 1;
  f[v] = x;
  v /= 2;
  while (v > 0) {
    f[v] = f[v * 2] + f[v * 2 + 1];
    v /= 2;
  }
}
int get_kth(int v, int l, int r, int k) {
  if (l == r) return l;
  if (f[v * 2] >= k) return get_kth(v * 2, l, (l + r) / 2, k);
  return get_kth(v * 2 + 1, (l + r) / 2 + 1, r, k - f[v * 2]);
}
int main() {
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++) scanf("%d", &a[i]);
  sz = 1;
  cnt = 0;
  m++;
  a[m] = n + 1;
  while (sz < n) sz *= 2;
  for (j = 1; j <= n; j++) {
    scanf("%d", &x);
    if (x >= 0) {
      cnt++;
      seq[cnt] = x;
      upd(cnt, 1);
      continue;
    }
    i = 1;
    while (f[1] >= a[i]) i++;
    while (i > 1) {
      i--;
      upd(get_kth(1, 1, sz, a[i]), 0);
    }
  }
  if (f[1] == 0)
    printf("Poor stack!\n");
  else {
    char q;
    for (i = 1; i <= f[1]; i++) {
      q = seq[get_kth(1, 1, sz, i)];
      putchar(q + 48);
    }
    printf("\n");
  }
}
