#include <bits/stdc++.h>
using namespace std;
const int debug = 0;
int a[1000010], cnt[2097200];
bool state[1000010], s[1000010];
void insert(int i, int j, int pos, int place, int val);
bool del(int i, int j, int pos, int place);
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) == 2) {
    int i, q, j, last = 0;
    memset(state, 0, sizeof(state));
    memset(cnt, 0, sizeof(cnt));
    for (i = 1; i <= m; ++i) scanf("%d", &a[i]);
    for (i = 1; i <= n; ++i) {
      scanf("%d", &q);
      if (q == -1) {
        for (j = 1; j <= m; ++j) {
          if (!del(1, n, 1, a[j] - j + 1)) break;
        }
        if (debug) puts("--");
      } else {
        insert(1, n, 1, ++last, q);
      }
    }
    if (!cnt[1])
      puts("Poor stack!");
    else {
      for (i = 1; i <= n; ++i)
        if (state[i] == 1) cout << s[i];
      puts("");
    }
    if (debug) puts("--------------");
  }
  return 0;
}
bool del(int i, int j, int pos, int place) {
  if (cnt[pos] < place) return 0;
  if (i == j) {
    if (debug) cout << "del from " << i << endl;
    state[i] = 0;
    cnt[pos] = 0;
    return 1;
  }
  int mid = (i + j) >> 1, l = pos << 1, r = l + 1;
  if (cnt[l] >= place)
    del(i, mid, l, place);
  else
    del(mid + 1, j, r, place - cnt[l]);
  cnt[pos] = cnt[l] + cnt[r];
  return 1;
}
void insert(int i, int j, int pos, int place, int val) {
  if (i == j) {
    state[i] = 1;
    s[i] = val;
    cnt[pos] = 1;
    return;
  }
  int mid = (i + j) >> 1, l = pos << 1, r = l + 1;
  if (place <= mid)
    insert(i, mid, l, place, val);
  else
    insert(mid + 1, j, r, place, val);
  cnt[pos] = cnt[l] + cnt[r];
}
