#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 5;
const int MAXS = 2 * MAXN;
int n, m, a[MAXN], st[MAXS], sz, bad[MAXS], cnt, t;
int tree[MAXS];
int read(int idx) {
  int ans = 0;
  for (idx++; idx; idx &= idx - 1) ans += tree[idx];
  return ans;
}
void update(int idx, int val) {
  for (idx++; idx < MAXS; idx += idx & -idx) tree[idx] += val;
}
int get(int a) {
  int lo = 0, hi = sz;
  while (lo < hi) {
    int m = lo + hi >> 1;
    if (m + 1 - read(m) >= a)
      hi = m;
    else
      lo = m + 1;
  }
  return lo;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; ++i) cin >> a[i];
  for (int I = 0; I < n; ++I) {
    cin >> t;
    if (t == -1) {
      int l = upper_bound(a, a + m, cnt) - a;
      for (int i = l - 1; i >= 0; --i) {
        int idx = get(a[i]);
        bad[idx] = true;
        update(idx, 1);
      }
      cnt -= l;
    } else {
      ++cnt;
      st[sz++] = t;
    }
  }
  if (cnt == 0)
    cout << "Poor stack!" << endl;
  else {
    for (int i = 0; i < sz; ++i) {
      if (!bad[i]) cout << st[i];
    }
    cout << endl;
  }
  return 0;
}
