#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
int T, N;
int len;
int q[1000010];
int e[1000010];
int a[1000010];
int t[1000010];
int qu[1000010];
int lowbit(int x) { return x & -x; }
void add(int x, int v) {
  while (x <= len) {
    e[x] += v;
    x += lowbit(x);
  }
}
int query(int x) {
  int sum = 0;
  while (x > 0) {
    sum += e[x];
    x -= lowbit(x);
  }
  return sum;
}
int main() {
  int m, n, k;
  cin.tie(0);
  while (scanf("%d", &n) != EOF) {
    scanf("%d", &m);
    memset(e, 0, 1000010);
    memset(q, 0, 1000010);
    len = n;
    for (int i = 1; i <= m; i++) scanf("%d", &a[i]);
    int op;
    int j = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &op);
      if (op == 0) {
        q[++j] = 0;
        add(j, 1);
      } else if (op == 1) {
        q[++j] = 1;
        add(j, 1);
      } else {
        memset(t, 0, k);
        k = 0;
        for (int i = 1; i <= m; i++) {
          if (a[i] <= query(j)) {
            int low = 1, high = j, mid;
            while (low <= high) {
              mid = (low + high) >> 1;
              int temp = query(mid);
              if (temp < a[i])
                low = mid + 1;
              else if (temp > a[i] || (temp == a[i] && query(mid - 1) == a[i]))
                high = mid - 1;
              else
                break;
            }
            t[++k] = mid;
          } else
            break;
        }
        for (int i = 1; i <= k; i++) add(t[i], -1);
      }
    }
    for (int i = 0; i <= j; i++) qu[i] = query(i);
    if (!qu[j])
      printf("Poor stack!\n");
    else {
      for (int i = 1; i <= j; i++)
        if (qu[i] - qu[i - 1]) printf("%d", q[i]);
    }
  }
  return 0;
}
