#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int m, n;
  cin >> m >> n;
  vector<int> A(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  int pow2 = 1;
  while (pow2 < m) {
    pow2 <<= 1;
  }
  vector<int> count(pow2 * 2 + 1, 0);
  vector<int> values(pow2 + 1, 0);
  int next_free = 0;
  for (int cas = 0; cas < m; cas++) {
    int x;
    cin >> x;
    if (x >= 0) {
      values[next_free] = x;
      int pos = pow2 + next_free;
      while (pos) {
        ++count[pos];
        pos /= 2;
      }
      ++next_free;
    } else {
      int cur_size = count[1];
      int i = 0;
      while (i < n) {
        int actual_pos = A[i];
        if (actual_pos > cur_size) break;
        actual_pos -= i;
        int pos = 1;
        while (pos < pow2) {
          if (count[pos * 2] < actual_pos) {
            actual_pos -= count[pos * 2];
            --count[pos];
            pos = pos * 2 + 1;
          } else {
            --count[pos];
            pos = 2 * pos;
          }
        }
        --count[pos];
        ++i;
      }
    }
  }
  if (count[1] == 0) {
    cout << "Poor stack!" << endl;
  } else {
    for (size_t i = 0; i < values.size() - 1; i++) {
      if (count[pow2 + i]) cout << values[i];
    }
    cout << endl;
  }
}
