#include <bits/stdc++.h>
using namespace std;
int a[1000005], bit[1000005], tot = 1, n, b[1000005], msk = 1;
bool np[1000005];
void add(int val, int idx) {
  while (idx <= n) {
    bit[idx] += val;
    idx += ((idx) & (-idx));
  }
}
int sum(int idx) {
  int sm = 0;
  while (idx) {
    sm += bit[idx];
    idx -= ((idx) & (-idx));
  }
  return sm;
}
int fposs(int sm) {
  int tmp = msk, nw, prev = 0;
  while (tmp) {
    if (bit[tmp + prev] < sm) {
      sm -= bit[tmp + prev];
      prev += tmp;
    }
    tmp >>= 1;
  }
  return prev + 1;
}
int main() {
  int m, i, j, pos, sm, val;
  scanf("%d%d", &n, &m);
  for ((i) = 0; (i) < (m); (i)++) {
    scanf("%d", &a[i]);
  }
  a[m] = 1000000000;
  while (2 * msk <= n) {
    msk *= 2;
  }
  for ((i) = 0; (i) < (n); (i)++) {
    scanf("%d", &val);
    if (val >= 0) {
      b[tot] = val;
      add(1, tot);
      tot++;
    } else {
      vector<int> tmp;
      sm = sum(tot);
      for (j = 0; a[j] <= sm; j++) {
        pos = fposs(a[j]);
        np[pos] = true;
        tmp.push_back(pos);
      }
      for ((j) = 0; (j) < (tmp.size()); (j)++) add(-1, tmp[j]);
    }
  }
  sm = sum(tot);
  if (sm == 0) {
    cout << "Poor stack!" << endl;
    return 0;
  }
  for (i = 1; i < tot; i++)
    if (!np[i]) printf("%d", b[i]);
  cout << endl;
  return 0;
}
