#include <bits/stdc++.h>
using namespace std;
template <typename Abel>
struct BIT {
  int sz;
  vector<Abel> dat;
  BIT(int n, Abel UNITY_SUM = 0) : sz(n + 1), dat(sz, UNITY_SUM) {}
  inline void add(int i, Abel x) {
    while (i < (int)dat.size()) {
      dat[i] += x;
      i += i & -i;
    }
  }
  inline Abel sum(int i) {
    Abel res = dat[0];
    while (i > 0) {
      res += dat[i];
      i -= i & -i;
    }
    return res;
  }
  inline Abel sum(int a, int b) { return sum(b - 1) - sum(a - 1); }
  int lower_bound(long long w) {
    if (w <= 0) return 0;
    int idx = 0, r = 1;
    while (r < sz) r <<= 1;
    for (int k = r >> 1; k > 0; k >>= 1) {
      if (idx + k < sz && dat[idx + k] < w) w -= dat[idx += k];
    }
    return idx + 1;
  }
  Abel operator[](int i) { return sum(i, i + 1); }
  friend ostream& operator<<(ostream& os, BIT<Abel>& bit) {
    for (int i = 1; i < bit.sz; i++) os << bit[i] << " ";
    return os;
  }
};
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (auto& ai : a) cin >> ai;
  BIT<int> alive(n);
  vector<int> v;
  for (int i = 0; i < n; i++) {
    int op;
    cin >> op;
    if (~op) {
      v.emplace_back(op);
      alive.add(v.size(), 1);
    } else {
      int p = upper_bound(begin(a), end(a), alive.sum(1, n + 1)) - begin(a);
      while (p--) alive.add(alive.lower_bound(a[p]), -1);
    }
  }
  string res;
  for (int i = 0; i < (int)v.size(); i++)
    if (alive[i + 1]) res += '0' + v[i];
  if (res.empty()) return !(cout << "Poor stack!" << endl);
  cout << res << endl;
  return 0;
}
