#include <bits/stdc++.h>
using namespace std;
const int MX = 1e6 + 10;
int a[MX], d[MX], bit[MX], todel[MX];
int len, dels;
int query(int idx) {
  int s = 0;
  for (; idx > 0; idx -= idx & -idx) s += bit[idx];
  return s;
}
int update(int idx) {
  for (; idx < MX; idx += idx & -idx) bit[idx] += 1;
}
int del(int idx) {
  int li, ls, mid, ans;
  li = 0, ls = len - 1;
  ans = -1;
  while (li <= ls) {
    mid = (li + ls) / 2;
    int vidx = mid - query(mid + 1);
    if (vidx < idx)
      li = mid + 1;
    else if (vidx > idx)
      ls = mid - 1;
    else {
      ans = mid;
      ls = mid - 1;
    }
  }
  return ans;
}
int main() {
  int n, m, op, li, ls, mid;
  fill(bit, bit + MX, 0);
  len = dels = 0;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) {
    scanf("%d", &op);
    if (op == -1) {
      int ans = -1;
      li = 0, ls = m - 1;
      while (li <= ls) {
        mid = (li + ls) / 2;
        if (a[mid] > len - dels) {
          ls = mid - 1;
        } else {
          ans = mid;
          li = mid + 1;
        }
      }
      for (int j = 0; j <= ans; j++) {
        todel[j] = del(a[j] - 1);
      }
      for (int j = 0; j <= ans; j++) {
        d[todel[j]] = -1;
        dels++;
        update(todel[j] + 1);
      }
    } else
      d[len++] = op;
  }
  if (len - dels == 0)
    cout << "Poor stack!";
  else
    for (int i = 0; i < len; i++)
      if (d[i] != -1) cout << d[i];
  cout << endl;
}
