#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 20;
int mt[N << 1];
void add(int x) {
  for (int i = N + x; i > 0; i >>= 1) ++mt[i];
}
void del(int x) {
  for (int i = N + x; i > 0; i >>= 1) --mt[i];
}
int get(int k, int i = -1) {
  if (k > mt[1] || k <= 0) return i;
  for (i = 1; i < N; i <<= 1)
    if (k > mt[i]) k -= mt[i++];
  return (i - N) + (k > mt[i]);
}
vector<int> a, s;
int main() {
  ios::sync_with_stdio(0);
  int n, m, i, j, x;
  cin >> n >> m;
  a.resize(m);
  s.resize(n);
  for (i = 0; i < m; ++i) cin >> a[i];
  for (i = 0; i < n; ++i) {
    cin >> x;
    s[i] = -1;
    if (x != -1) {
      add(i);
      s[i] = x;
    } else {
      for (j = 0; j < m; ++j) {
        int p = get(a[j] - j);
        if (p == -1) break;
        s[p] = -1;
        del(p);
      }
    }
  }
  for (i = 0; i < n; ++i)
    if (s[i] != -1) break;
  if (i == n)
    cout << "Poor stack!\n";
  else {
    for (i = 0; i < n; ++i)
      if (s[i] != -1) cout << s[i];
    cout << '\n';
  }
  return 0;
}
