#include <bits/stdc++.h>
using namespace std;
int tree[5000000];
int read(int idx) {
  int sum = 0;
  while (idx > 0) {
    sum += tree[idx];
    idx -= (idx & -idx);
  }
  return sum;
}
void update(int idx, int val) {
  while (idx <= 1024 * 1025) {
    tree[idx] += val;
    idx += (idx & -idx);
  }
}
int findG(int cumFre) {
  int idx = 0;
  int bitMask = 1 << 20;
  int tIdx;
  while ((bitMask != 0) && (idx < 1024 * 1025)) {
    tIdx = idx + bitMask;
    if (cumFre >= tree[tIdx]) {
      idx = tIdx;
      cumFre -= tree[tIdx];
    }
    bitMask >>= 1;
  }
  if (cumFre != 0)
    return -1;
  else
    return idx;
}
int arr[1000000];
vector<int> val;
int main() {
  int n, m;
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  int id = 1;
  int sz = 0;
  for (int i = 0; i < m; i++) {
    int a;
    scanf("%d", &a);
    if (a != -1) {
      update(id, 1);
      val.push_back(a);
      sz++;
      id++;
    } else {
      int st = 0;
      int end = n;
      int mid;
      while (st < end) {
        mid = st + (end - st) / 2;
        if (arr[mid] > sz)
          end = mid;
        else
          st = mid + 1;
      }
      int t[10000];
      for (int i = 0; i < st; i++) {
        t[i] = findG(arr[i] - 1);
        val[t[i]] = -1;
      }
      for (int i = 0; i < st; i++) {
        update(t[i] + 1, -1);
      }
      sz -= st;
    }
  }
  if (sz == 0)
    cout << "Poor stack!";
  else
    for (int i = 0; i < val.size(); i++)
      if (val[i] != -1) cout << val[i];
}
