#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000007;
const int N = 1000005;
int ft[N];
int a[N];
int b[N];
int op[N];
int n, m;
void update(int pos, int val) {
  while (pos < N) {
    ft[pos] += val;
    pos += pos & (-pos);
  }
}
int query(int pos) {
  int sum = 0;
  while (pos > 0) {
    sum += ft[pos];
    pos -= pos & (-pos);
  }
  return sum;
}
int find(int x) {
  int lo = 1, hi = m;
  int ans;
  while (lo <= hi) {
    int m = (lo + hi) / 2;
    int val = query(m);
    if (val < x)
      lo = m + 1;
    else if (val > x)
      hi = m - 1;
    else if (val == x) {
      ans = m;
      hi = m - 1;
    }
  }
  return ans;
}
int main() {
  cin >> m >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int len = 0;
  memset(ft, 0, sizeof ft);
  for (int i = 1; i <= m; i++) {
    cin >> op[i];
    if (op[i] == 0 || op[i] == 1) {
      update(i, 1);
      len++;
    } else {
      int cur = 0;
      for (int j = 0; j < n && a[j] <= len; j++) b[cur++] = find(a[j]);
      for (int j = 0; j < cur; j++) update(b[j], -1);
      len -= cur;
    }
  }
  if (len == 0)
    cout << "Poor stack!" << endl;
  else {
    for (int i = 1; i <= m; i++) {
      if (query(i) > 0) {
        cout << op[i];
        update(i, -1);
      }
    }
    cout << endl;
  }
}
