#include <bits/stdc++.h>
using namespace std;
const int inf = 2000000000;
static inline int Rint() {
  struct X {
    int dig[256];
    X() {
      for (int i = '0'; i <= '9'; ++i) dig[i] = 1;
      dig['-'] = 1;
    }
  };
  static X fuck;
  int s = 1, v = 0, c;
  for (; !fuck.dig[c = getchar()];)
    ;
  if (c == '-')
    s = 0;
  else if (fuck.dig[c])
    v = c ^ 48;
  for (; fuck.dig[c = getchar()]; v = v * 10 + (c ^ 48))
    ;
  return s ? v : -v;
}
template <typename T>
static inline void cmax(T& a, const T& b) {
  if (b > a) a = b;
}
template <typename T>
static inline void cmin(T& a, const T& b) {
  if (b < a) a = b;
}
const int maxn = 100005;
int data[1 << 20];
int que[1 << 20];
int A[1 << 20];
int flag[1 << 20];
int main() {
  const int n = Rint(), m = Rint();
  for (int i = 1; i <= m; ++i) {
    A[i] = Rint();
    flag[A[i]] = 1;
  }
  int top = 0;
  int p = 0, q = 0;
  for (int event = 0; event < n; ++event) {
    const int now = Rint();
    if (now >= 0) {
      que[q++] = now;
      while (p < q && top + 1 <= A[m]) {
        data[++top] = que[p++];
      }
    } else {
      int new_top = A[1] - 1;
      if (new_top > top) new_top = top;
      for (int i = new_top + 1; i <= top; ++i)
        if (flag[i] == 0) {
          data[++new_top] = data[i];
        }
      top = new_top;
      while (p < q && top + 1 <= A[m]) {
        data[++top] = que[p++];
      }
    }
  }
  while (p < q) {
    data[++top] = que[p++];
  }
  if (top == 0) {
    puts("Poor stack!");
  } else {
    for (int i = 1; i <= top; ++i) printf("%d", data[i]);
    puts("");
  }
  return 0;
}
