#include <bits/stdc++.h>
using namespace std;
const int maxN = 1000 * 1000 + 5;
const int mod = 1000 * 1000 * 1000 + 7;
int fen[maxN];
int ans[maxN];
int a[maxN];
void add(int n, int k) {
  for (; n < maxN; n += n & (-n)) fen[n] += k;
}
int get(int n) {
  int res = 0;
  for (; n > 0; n -= n & (-n)) res += fen[n];
  return res;
}
int bin(int t) {
  int lo = 0, hi = maxN - 3;
  while (hi - lo > 1) {
    int mid = (hi + lo) >> 1;
    if (get(mid) >= t)
      hi = mid;
    else
      lo = mid;
  }
  return hi;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    int t;
    cin >> t;
    if (t > -1) {
      ans[i] = t;
      add(i, 1);
      continue;
    }
    int cnt = get(maxN - 2);
    int ps = upper_bound(a, a + m, cnt) - a;
    for (int j = ps - 1; j >= 0; j--) {
      int pos = bin(a[j]);
      add(pos, -1);
    }
  }
  int cnt = get(maxN - 2);
  if (cnt == 0) {
    cout << "Poor stack!" << endl;
    return 0;
  }
  for (int i = 1; i <= cnt; i++) {
    int pos = bin(i);
    cout << ans[pos];
  }
  cout << endl;
  return 0;
}
