#include <bits/stdc++.h>
using namespace std;
int a[2000010], dp[2000010], c[2000010], cnt;
inline int lowbit(int x) { return x & (-x); }
void updata(int x, int pos) {
  int i;
  for (i = pos; i <= 1000000; i += lowbit(i)) {
    c[i] += x;
  }
}
int sum(int pos) {
  int i, sum = 0;
  for (i = pos; i > 0; i -= lowbit(i)) sum += c[i];
  return sum;
}
int my_find(int x) {
  int l = 1, r = cnt, mid, tp, ans = -1;
  while (l <= r) {
    mid = (l + r) / 2;
    tp = sum(mid);
    if (tp == x) {
      ans = mid;
      r = mid - 1;
    } else if (tp > x)
      r = mid - 1;
    else
      l = mid + 1;
  }
  return ans;
}
int main() {
  int i, j, n, m, cmd, pos, num;
  while (scanf("%d%d", &n, &m) != EOF) {
    num = cnt = 0;
    memset(c, 0, sizeof(c));
    for (i = 1; i <= m; i++) scanf("%d", &a[i]);
    while (n--) {
      scanf("%d", &cmd);
      if (cmd == -1) {
        for (i = 1; i <= m; i++) {
          pos = my_find(a[i] - i + 1);
          if (pos == -1) break;
          updata(-1, pos);
          num--;
        }
      } else {
        cnt++;
        num++;
        dp[cnt] = cmd;
        updata(1, cnt);
      }
    }
    if (num == 0) {
      puts("Poor stack!");
      continue;
    }
    for (i = 1; i <= num; i++) {
      pos = my_find(i);
      printf("%d", dp[pos]);
    }
    puts("");
  }
  return 0;
}
