#include <bits/stdc++.h>
using namespace std;
int n, m;
int c[1000005];
int a[1000005], b[1000005], del[1000005];
vector<int> vec;
int lowbit(int x) { return x & (-x); }
int add(int pos, int val) {
  while (pos <= n) {
    c[pos] += val;
    pos += lowbit(pos);
  }
}
int getsum(int pos) {
  int ans = 0;
  while (pos) {
    ans += c[pos];
    pos -= lowbit(pos);
  }
  return ans;
}
int bin(int l, int r, int x) {
  int m;
  while (l <= r) {
    m = (l + r) >> 1;
    if (m - getsum(m) < x)
      l = m + 1;
    else
      r = m - 1;
  }
  return l;
}
int main() {
  int i, j, k, pos, op, len, left;
  while (scanf("%d%d", &n, &m) != EOF) {
    len = left = 0;
    memset(c, 0, sizeof(c));
    memset(del, 0, sizeof(del));
    for (i = 1; i <= m; i++) scanf("%d", &a[i]);
    for (i = 1; i <= n; i++) {
      scanf("%d", &op);
      if (op != -1) {
        b[++len] = op;
        left++;
      } else {
        for (j = 1; j <= m && a[j] <= left; j++) vec.push_back(a[j]);
        for (j = vec.size() - 1; j >= 0; j--) {
          pos = bin(1, len, vec[j]);
          del[pos] = 1;
          add(pos, 1);
        }
        left -= vec.size();
        vec.clear();
      }
    }
    if (!left)
      printf("Poor stack!\n");
    else {
      for (i = 1; i <= len; i++)
        if (!del[i]) printf("%d", b[i]);
      printf("\n");
    }
  }
  return 0;
}
