#include <bits/stdc++.h>
using namespace std;
int a[1000005], before[1000005], punch_req[1000005];
int punch_before[1000005], visit[1000005], curr_string_len[1000005];
int main() {
  int n, m, x;
  scanf("%d%d", &n, &m);
  for (int(i) = 0; i < m; i++) {
    scanf("%d", &x);
    visit[x] = 1;
  }
  for (int(i) = 1; i < n + 1; i++) before[i] = before[i - 1] + visit[i];
  for (int(i) = 1; i < n + 1; i++) {
    if (visit[i])
      punch_req[i] = 1;
    else {
      if (before[i] == 0)
        punch_req[i] = -1;
      else
        punch_req[i] = punch_req[i - before[i]] + 1;
    }
  }
  int len = 0;
  for (int(i) = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] == -1)
      len -= before[len];
    else
      curr_string_len[i] = ++len;
    punch_before[i] = punch_before[i - 1] + (a[i] == -1);
  }
  bool flag = false;
  for (int(i) = 0; i < n; i++) {
    if (a[i] != -1) {
      if ((punch_req[curr_string_len[i]] >
           punch_before[n - 1] - punch_before[i]) ||
          punch_req[curr_string_len[i]] == -1) {
        cout << a[i];
        flag = 1;
      }
    }
  }
  if (!flag) cout << "Poor stack!";
  printf("\n");
  return 0;
}
