#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000050;
int n, m, a[MAXN], tree[3 * MAXN], st[MAXN];
int b[MAXN];
bool seen[MAXN];
void update(int idx, int l, int r, int cur, int val) {
  if (l == r) {
    tree[cur] = val;
    seen[idx] = !val;
    return;
  }
  int mid = (l + r) / 2;
  if (idx <= mid) {
    update(idx, l, mid, 2 * cur, val);
  } else {
    update(idx, mid + 1, r, 2 * cur + 1, val);
  }
  tree[cur] = tree[2 * cur] + tree[2 * cur + 1];
}
int get(int val, int l, int r, int cur) {
  if (l == r) {
    return l;
  }
  int mid = (l + r) / 2;
  if (val <= tree[2 * cur]) {
    return get(val, l, mid, 2 * cur);
  } else {
    return get(val - tree[2 * cur], mid + 1, r, 2 * cur + 1);
  }
}
void debug() {
  cout << "b: ";
  for (int i = 1; i <= 11; i++) cout << b[i] << " ";
  cout << endl;
  for (int i = 1; i <= 11; i++) cout << seen[i] << " ";
  cout << endl;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) scanf("%d", &a[i]);
  int num = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &st[i]);
    if (st[i] != -1) {
      update(i, 1, MAXN, 1, 1);
      num++;
    } else {
      int k = 0;
      for (int j = 1; j <= m; j++) {
        if (a[j] > num) break;
        b[++k] = get(a[j], 1, MAXN, 1);
      }
      for (int j = 1; j <= k; j++) {
        update(b[j], 1, MAXN, 1, 0);
        num--;
      }
    }
  }
  bool ok = false;
  for (int i = 1; i <= n; i++) {
    if (!seen[i] && st[i] != -1) {
      printf("%d", st[i]);
      ok = true;
    }
  }
  if (!ok) printf("Poor stack!");
  return 0;
}
