#include <bits/stdc++.h>
using namespace std;
const int N = 1000007;
int n, q, a[N];
struct node {
  node *l, *r;
  int p, size, val;
  node() {
    l = r = NULL;
    p = rand() | (rand() << 15);
    size = 1;
    val = 0;
  }
} * root;
typedef node *pnode;
inline int getSize(pnode T) { return T ? T->size : 0; }
inline void fixSize(pnode T) {
  if (T) T->size = 1 + getSize(T->l) + getSize(T->r);
}
void merge(pnode A, pnode B, pnode &T) {
  if (!A || !B)
    T = (A ? A : B);
  else {
    if (A->p > B->p) {
      merge(A->r, B, A->r);
      T = A;
    } else {
      merge(A, B->l, B->l);
      T = B;
    }
  }
  fixSize(T);
}
void split(pnode T, int k, pnode &LT, pnode &RT, int add = 0) {
  if (!T) {
    LT = RT = NULL;
    return;
  }
  int cur = add + getSize(T->l);
  if (cur >= k) {
    split(T->l, k, LT, T->l, add);
    RT = T;
  } else {
    split(T->r, k, T->r, RT, cur + 1);
    LT = T;
  }
  fixSize(LT);
  fixSize(RT);
}
void pushBack(int val) {
  pnode A = new node();
  A->val = val;
  merge(root, A, root);
}
void erase(int pos) {
  pnode LT, RT, MT;
  split(root, pos, LT, RT);
  split(RT, 1, MT, RT);
  merge(LT, RT, root);
}
void print(pnode T) {
  if (!T) return;
  print(T->l);
  printf("%d", T->val);
  print(T->r);
}
int main() {
  scanf("%d%d", &q, &n);
  root = NULL;
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]), --a[i];
  while (q--) {
    int op;
    scanf("%d", &op);
    if (op == -1) {
      int l = 0;
      int r = n - 1;
      int len = getSize(root);
      while (l < r) {
        int m = (l + r + 1) / 2;
        if (a[m] < len)
          l = m;
        else
          r = m - 1;
      }
      if (l == 0 && a[0] >= len) continue;
      for (int i = l; i >= 0; --i) erase(a[i]);
    } else
      pushBack(op);
  }
  if (getSize(root) == 0)
    puts("Poor stack!");
  else
    print(root);
  return 0;
}
