#include <bits/stdc++.h>
using namespace std;
int n, m;
struct node {
  node* c[2];
  int v, r, sz;
  void up() { sz = c[0]->sz + c[1]->sz + 1; }
  int cmp(int x) const {
    if (x == v) return -1;
    return x > v;
  }
} * root, *null;
void newNode(node*& o, int v) {
  o = new node();
  o->sz = 1;
  o->v = v;
  o->r = rand();
  o->c[0] = o->c[1] = null;
}
void rot(node*& o, int d) {
  node* p = o->c[d];
  o->c[d] = p->c[!d];
  p->c[!d] = o;
  o->up();
  p->up();
  o = p;
}
void ins(node*& o, int v) {
  if (o == null) {
    newNode(o, v);
    return;
  }
  int d = o->cmp(v);
  if (d == -1) return;
  ins(o->c[d], v);
  if (o->r > o->c[d]->r) rot(o, d);
  o->up();
}
void del(node*& o, int v) {
  if (o == null) return;
  int d = o->cmp(v);
  if (d == -1) {
    if (o->c[0] == null || o->c[1] == null) {
      if (o->c[0] == null)
        o = o->c[1];
      else
        o = o->c[0];
      return;
    }
    d = (o->c[1]->r) < (o->c[0]->r);
    rot(o, d);
    del(o->c[!d], v);
  } else
    del(o->c[d], v);
  o->up();
}
int findk(node* o, int k) {
  int t = o->c[0]->sz + 1;
  if (t == k) return o->v;
  if (k > t) return findk(o->c[1], k - t);
  return findk(o->c[0], k);
}
int a[1000006], val[1000006], tot;
void out() {
  if (!root->sz) {
    puts("Poor stack!");
    return;
  }
  for (int i = 1; i <= root->sz; i++) printf("%d", val[findk(root, i)]);
  puts("");
}
int main() {
  newNode(null, 0);
  null->sz = 0;
  root = null;
  int i;
  scanf("%d%d", &n, &m);
  for (i = 0; i < m; i++) scanf("%d", &a[i]);
  while (n--) {
    int v;
    scanf("%d", &v);
    if (~v) {
      ins(root, tot);
      val[tot++] = v;
    } else {
      int sz = root->sz;
      for (i = 0; i < m && a[i] <= sz; i++) del(root, findk(root, a[i] - i));
    }
  }
  out();
  return 0;
}
