#include <bits/stdc++.h>
using namespace std;
const int UB = 20;
const int N = (1 << UB) + 11;
inline int LB(int x) { return x & -x; }
struct BIT {
  int a[N];
  void init() {
    for (int i = 0; i < N; i++) a[i] = 0;
  }
  void add(int x, int d) {
    for (; x < N; x += LB(x)) a[x] += d;
  }
  int sum(int x) {
    int s = 0;
    for (; x > 0; x -= LB(x)) s += a[x];
    return s;
  }
  bool test(int x) { return sum(x) - sum(x - 1) == 1; }
  void sub(int k) {
    int p = 0, i = UB - 1;
    while (k > 0 && i >= 0) {
      if (k > a[p | 1 << i]) k -= a[p |= 1 << i];
      i--;
    }
    p++;
    add(p, -1);
  }
} bit;
int id[N], rid[N];
char s[N];
int main() {
  int n, m, op;
  while (~scanf("%d%d", &n, &m)) {
    bit.init();
    for (int i = 0; i < m; i++) cin >> id[i];
    for (int i = 0; i < m; i++) rid[i] = id[i] - i;
    int c = 1, sz;
    while (n--) {
      scanf("%d", &op);
      if (op < 0) {
        sz = bit.sum(c);
        for (int i = 0; i < m; i++) {
          if (id[i] > sz) break;
          bit.sub(rid[i]);
        }
      } else {
        bit.add(c, 1);
        s[c++] = '0' + op;
      }
    }
    if (bit.sum(c)) {
      for (int i = 1; i < c; i++)
        if (bit.test(i)) putchar(s[i]);
      puts("");
    } else
      puts("Poor stack!");
  }
  return 0;
}
