#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7;
int n, m, a[N], b[N], f[N], suf[N];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = (0); i < (m); ++i) scanf("%d", a + i);
  int p = 0;
  for (int i = (1); i < (n + 1); ++i) {
    while (p < m && a[p] <= i) ++p;
    f[i] = !p ? INT_MAX : f[i - p] + 1;
    if (p) f[a[p - 1]] = 1;
  }
  for (int i = (1); i < (n + 1); ++i) scanf("%d", b + i);
  suf[n + 1] = 0;
  for (int i = n; i > 0; --i) suf[i] = suf[i + 1] + (b[i] == -1);
  int tot = 0, out = 0;
  for (int i = (1); i < (n + 1); ++i) {
    if (b[i] != -1) {
      ++tot;
      if (f[tot] > suf[i]) out = 1, printf("%d", b[i]);
    } else {
      tot -= upper_bound(a, a + m, tot) - a;
    }
  }
  if (!out) puts("Poor stack!");
  return 0;
}
