#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
pair<int, int> tree[4 * N];
string ans;
void build(int idx, int l, int r) {
  if (l == r) {
    tree[idx].first = 0;
    tree[idx].second = -1;
    return;
  }
  int mid = (r + l) / 2;
  build(idx * 2, l, mid);
  build(idx * 2 + 1, mid + 1, r);
  tree[idx].first = tree[2 * idx].first + tree[2 * idx + 1].first;
  tree[idx].second = -1;
}
void add(int x, int l, int r, int idx, int val) {
  if (l == r) {
    tree[x].first = 1;
    tree[x].second = val;
    return;
  }
  int mid = (r + l) / 2;
  if (idx <= mid)
    add(2 * x, l, mid, idx, val);
  else
    add(2 * x + 1, mid + 1, r, idx, val);
  tree[x].first = tree[2 * x].first + tree[2 * x + 1].first;
  tree[x].second = -1;
}
void del(int x, int l, int r, int val) {
  if (l == r) {
    tree[x].first = 0;
    tree[x].second = -1;
    return;
  }
  int mid = (r + l) / 2;
  if (val <= tree[2 * x].first)
    del(2 * x, l, mid, val);
  else
    del(2 * x + 1, mid + 1, r, val - tree[2 * x].first);
  tree[x].first = tree[2 * x].first + tree[2 * x + 1].first;
  tree[x].second = -1;
}
void print(int x, int l, int r) {
  if (tree[x].first == 0) return;
  if (l == r && tree[x].first == 1) {
    ans.push_back('0' + tree[x].second);
    return;
  }
  int mid = (r + l) / 2;
  print(2 * x, l, mid);
  print(2 * x + 1, mid + 1, r);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, last = 0, l = 0;
  int a[1000010];
  cin >> n >> m;
  build(1, 0, N - 1);
  for (int i = 0; i < m; i++) cin >> a[i];
  for (int k = 0; k < n; k++) {
    int x;
    cin >> x;
    if (x == -1) {
      int j = 0;
      while (j < m && a[j] <= tree[1].first) j++;
      j--;
      while (j >= 0) {
        del(1, 0, N - 1, a[j]);
        j--;
      }
    } else
      add(1, 0, N - 1, last++, x);
  }
  print(1, 0, N - 1);
  if (ans.size() == 0) ans = "Poor stack!";
  cout << ans << endl;
  return 0;
}
