#include <bits/stdc++.h>
using namespace std;
const long long int INF = (long long int)1e9 + 10;
const long long int INFLL = (long long int)1e18 + 10;
const long double EPS = 1e-8;
const long double EPSLD = 1e-18;
const long long int MOD = 1e9 + 7;
template <class T>
T &chmin(T &a, const T &b) {
  return a = min(a, b);
}
template <class T>
T &chmax(T &a, const T &b) {
  return a = max(a, b);
}
struct node {
  int val;
  int size;
  node *chl, *chr;
  node() {
    size = 1;
    chl = chr = NULL;
  }
  node(int val) : val(val) {
    size = 1;
    chl = chr = NULL;
  }
};
typedef pair<node *, node *> pn;
node nodes[1000000];
int np;
node *root = NULL;
mt19937 mt(time(NULL));
int size(node *t) { return !t ? 0 : t->size; }
int val(node *t) { return !t ? 0 : t->val; }
node *newnode(int val) {
  nodes[np] = node(val);
  return &nodes[np++];
}
node *update(node *t) {
  t->size = size(t->chl) + size(t->chr) + 1;
  return t;
}
node *merge(node *l, node *r) {
  if (!l) return r;
  if (!r) return l;
  if ((int)mt() % (size(l) + size(r)) < size(l)) {
    l->chr = merge(l->chr, r);
    return update(l);
  } else {
    r->chl = merge(l, r->chl);
    return update(r);
  }
}
pn split(node *t, int k) {
  if (!t) return pn(NULL, NULL);
  if (k <= size(t->chl)) {
    pn s = split(t->chl, k);
    t->chl = s.second;
    return pn(s.first, update(t));
  } else {
    pn s = split(t->chr, k - size(t->chl) - 1);
    t->chr = s.first;
    return pn(update(t), s.second);
  }
}
node *insert(node *t, int k, int val) {
  pn s = split(t, k);
  node *u = newnode(val);
  return merge(merge(s.first, u), s.second);
}
node *erase(node *t, int k) {
  pn sa = split(t, k);
  pn sb = split(sa.second, 1);
  return merge(sa.first, sb.second);
}
node *find(node *t, int k) {
  if (!t) return NULL;
  if (k < size(t->chl))
    return find(t->chl, k);
  else if (k == size(t->chl))
    return t;
  else
    return find(t->chr, k - size(t->chl) - 1);
}
const long long int MAX_N = 1000010;
long long int n, m;
long long int a[MAX_N];
int main() {
  scanf("%lld %lld", &n, &m);
  for (long long int i = (0); i < (long long int)(m); i++)
    scanf("%lld", &a[i]), a[i]--;
  for (long long int i = (0); i < (long long int)(n); i++) {
    long long int x;
    scanf("%lld", &x);
    if (x == -1) {
      for (long long int i = (0); i < (long long int)(m); i++) {
        if (size(root) > a[i] - i)
          root = erase(root, a[i] - i);
        else
          break;
      }
    } else {
      root = insert(root, size(root), x);
    }
  }
  if (size(root) == 0)
    printf("Poor stack!");
  else
    for (long long int i = (0); i < (long long int)(size(root)); i++)
      printf("%d", val(find(root, i)));
  printf("\n");
  return 0;
}
