#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000005;
int b[MAXN];
int a[MAXN];
int q[MAXN];
int ha[MAXN];
int flag[MAXN];
vector<int> V;
vector<int>::iterator it;
int sum[MAXN << 2];
void pushup(int o) { sum[o] = sum[o << 1] + sum[o << 1 | 1]; }
void build(int l, int r, int o) {
  if (l == r) {
    sum[o] = 1;
    return;
  }
  int m = l + r >> 1;
  build(l, m, o << 1);
  build(m + 1, r, o << 1 | 1);
  pushup(o);
}
int res;
void query(int l, int r, int o, int L, int R) {
  if (L <= l && r <= R) {
    res += sum[o];
    return;
  }
  int m = l + r >> 1;
  if (L <= m) query(l, m, o << 1, L, R);
  if (m < R) query(m + 1, r, o << 1 | 1, L, R);
}
void update(int l, int r, int o, int L, int R, int v) {
  if (l == r) {
    sum[o] = 0;
    flag[l] = 1;
    return;
  }
  int m = l + r >> 1;
  if (L <= m && v <= sum[o << 1])
    update(l, m, o << 1, L, R, v);
  else if (L <= m && v > sum[o << 1]) {
    v -= sum[o << 1];
    update(m + 1, r, o << 1 | 1, L, R, v);
  } else if (m < R)
    update(m + 1, r, o << 1 | 1, L, R, v);
  pushup(o);
}
int main() {
  int n, m, top = 0, cnt = 0;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d", &a[i]);
    ha[a[i]] = i;
    V.push_back(-a[i]);
  }
  for (int i = 0; i < n; i++) {
    int v;
    scanf("%d", &v);
    if (v == -1)
      q[cnt++] = top;
    else
      b[top++] = v;
  }
  if (top == 0) {
    printf("Poor stack!\n");
    return 0;
  }
  sort(V.begin(), V.end());
  build(0, top - 1, 1);
  for (int i = 0; i < cnt; i++) {
    int len = 0;
    res = 0;
    if (q[i] > 0) query(0, top - 1, 1, 0, q[i] - 1);
    len += res;
    it = lower_bound(V.begin(), V.end(), -len);
    if (it == V.end()) continue;
    int id = ha[-(*it)];
    for (int j = id; j >= 0; j--) {
      int v = a[j];
      update(0, top - 1, 1, 0, q[i] - 1, v);
    }
  }
  if (sum[1] == 0)
    printf("Poor stack!\n");
  else {
    for (int i = 0; i < top; i++)
      if (flag[i] == 0) printf("%d", b[i]);
    printf("\n");
  }
  return 0;
}
