#include <bits/stdc++.h>
using namespace std;
int num[1000006];
int valid[1000006];
int seq[1000006];
int new_cur[1000006];
int n, m;
void precal() {
  int i, idx = 0, del = 1;
  for (i = 1; i < num[idx]; i++) {
    valid[i] = 1e6 + 6;
    new_cur[i] = i;
  }
  valid[i] = 1;
  new_cur[i] = i - del;
  for (i++; i < 1000006; i++) {
    if (idx + 1 < m && num[idx + 1] <= i) {
      idx++;
      del++;
    }
    if (num[idx] == i) {
      valid[i] = 1;
    } else {
      valid[i] = 1 + valid[i - del];
    }
    new_cur[i] = i - del;
  }
}
int tree[1000006];
int main() {
  int type;
  int cur = 0, len = 0;
  bool empty = 1;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d", &num[i]);
  }
  precal();
  for (int i = 1; i <= n; i++) {
    scanf("%d", &type);
    if (type == -1) {
      tree[len] += -1;
      cur = new_cur[cur];
    } else {
      cur++;
      seq[++len] = type;
      tree[len] += valid[cur];
      if (len) tree[len - 1] += (-valid[cur]);
    }
  }
  for (int i = len - 1; i > 0; i--) {
    tree[i] += tree[i + 1];
  }
  for (int i = 1; i <= len; i++) {
    if (tree[i] > 0) {
      empty = 0;
      printf("%d", seq[i]);
    }
  }
  if (empty) puts("Poor stack!");
}
