#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(T p, T e, T M) {
  if (e == 0) return 1;
  if (e % 2 == 0) {
    long long t = bigmod(p, e / 2, M);
    return (T)((t * t) % M);
  }
  return (T)(((long long)bigmod(p, e - 1, M) * (long long)(p)) % M);
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
long long seg[4000001], ar[1000001], val[1000001];
void insert(int idx, int s, int e, int p, int v) {
  if (s == e) {
    seg[idx] = v;
    return;
  }
  int mid = (s + e) / 2;
  if (p <= mid)
    insert(idx * 2 + 1, s, mid, p, v);
  else
    insert(idx * 2 + 2, mid + 1, e, p, v);
  seg[idx] = seg[idx * 2 + 1] + seg[idx * 2 + 2];
}
long long query(int idx, int s, int e, int p) {
  if (seg[idx] < p) return -1;
  if (s == e) return s;
  int mid = (s + e) / 2;
  if (p <= seg[idx * 2 + 1])
    return query(idx * 2 + 1, s, mid, p);
  else
    return query(idx * 2 + 2, mid + 1, e, p - seg[idx * 2 + 1]);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long a, b, c, d, e, f, g, h = 1, x, y, z;
  cin >> a >> b;
  for (int i = (0); i < (b); ++i) cin >> ar[i];
  c = 0;
  for (int i = (0); i < (a); ++i) {
    cin >> d;
    if (d == -1) {
      for (int j = (0); j < (b); ++j) {
        e = query(0, 1, 1000000, ar[j] - j);
        if (e == -1) break;
        insert(0, 1, 1000000, e, 0);
      }
    } else {
      c++;
      val[c] = d;
      insert(0, 1, 1000000, c, 1);
    }
  }
  if (seg[0] == 0)
    cout << "Poor stack!" << endl;
  else {
    for (int i = (1); i < (seg[0] + 1); ++i) {
      e = query(0, 1, 1000000, i);
      cout << val[e];
    }
  }
}
