#include <bits/stdc++.h>
struct Node {
  int left, right;
  int cnt;
};
const int MAX_SIZE = 1000000;
int w[MAX_SIZE + 10];
int seq[MAX_SIZE + 10], bound[MAX_SIZE + 10];
bool exist[MAX_SIZE + 10];
int top, hn, n, m;
int root;
Node tree[MAX_SIZE * 2 + 100];
int tn;
int bsearch(int v) {
  int l = 0, r = m - 1;
  int mid;
  while (l < r) {
    mid = (l + r) >> 1;
    if (v < w[mid])
      r = mid;
    else
      l = mid + 1;
  }
  if (v < w[l]) --l;
  return l;
}
int build(int l, int r) {
  if (l > r) return 0;
  int cur = ++tn;
  tree[cur].cnt = r - l + 1;
  if (l == r)
    tree[cur].left = tree[cur].right = 0;
  else {
    int mid = (l + r) >> 1;
    tree[cur].left = build(l, mid);
    tree[cur].right = build(mid + 1, r);
  }
  return cur;
}
void tagKth(int cur, int k, int l, int r) {
  if (l == r) {
    tree[cur].cnt--;
    exist[l] = false;
    return;
  }
  int mid = (l + r) >> 1;
  if (tree[tree[cur].left].cnt >= k)
    tagKth(tree[cur].left, k, l, mid);
  else
    tagKth(tree[cur].right, k - tree[tree[cur].left].cnt, mid + 1, r);
  --tree[cur].cnt;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) scanf("%d", w + i);
  int cnt = 0;
  top = hn = 0;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    if (x == -1) {
      bound[hn] = bsearch(cnt);
      cnt -= bound[hn] + 1;
      ++hn;
    } else {
      seq[top++] = x;
      ++cnt;
    }
  }
  tn = 0;
  root = build(0, top - 1);
  memset(exist, 1, sizeof(exist));
  for (int i = 0; i < hn; i++) {
    for (int j = bound[i]; j >= 0; j--) tagKth(root, w[j], 0, top - 1);
  }
  bool flag = false;
  for (int i = 0; i < top; i++) {
    if (exist[i]) {
      flag = true;
      printf("%d", seq[i]);
    }
  }
  if (flag)
    printf("\n");
  else
    printf("Poor stack!\n");
  return 0;
}
