#include <bits/stdc++.h>
using namespace std;
int n, m, q[1000010], a[1000010], del[1000010], sz[1000010], p[1000010];
stack<int> res;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) scanf("%d", &a[i]);
  if (a[m] <= n) a[m + 1] = n + 1;
  for (int i = 1; i <= m; i++)
    for (int j = a[i]; j < a[i + 1]; j++) p[j] = i;
  for (int i = 1; i <= n; i++) scanf("%d", &q[i]);
  for (int i = 0; i < a[1]; i++) del[i] = n;
  for (int i = 1; i <= m; i++) {
    del[a[i]] = 1;
    for (int j = a[i] + 1; j < a[i + 1]; j++) del[j] = del[j - i] + 1;
  }
  for (int i = 1; i <= n; i++) {
    if (q[i] == 1 || q[i] == 0)
      sz[i] = sz[i - 1] + 1;
    else
      sz[i] = sz[i - 1] - p[sz[i - 1]];
  }
  if (!sz[n]) {
    puts("Poor stack!");
    return 0;
  }
  int k = 0;
  for (int i = n; i >= 1; i--) {
    if (q[i] == -1)
      k++;
    else if (del[sz[i]] > k)
      res.push(q[i]);
  }
  while (!res.empty()) {
    printf("%d", res.top());
    res.pop();
  }
}
