#include <bits/stdc++.h>
using namespace std;
int N, M;
int quitar[1000005];
int A;
bool final[1000005];
int BIT[1000005];
void update(int i, int x) {
  for (; i <= N; i += i & -i) BIT[i] += x;
}
int query(int i) {
  int suma = 0;
  for (; i > 0; i -= i & -i) suma += BIT[i];
  return suma;
}
int bin(int x) {
  int ini = 1, fin = N + 1, medio;
  while (ini < fin) {
    medio = (ini + fin) / 2;
    if (query(medio) < x)
      ini = medio + 1;
    else
      fin = medio;
  }
  return ini;
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= M; i++) scanf("%d", &quitar[i]);
  for (int i = 1; i <= N; i++) {
    scanf("%d", &A);
    if (A == -1) {
      for (int j = 1; j <= M; j++) {
        int pos = bin(quitar[j] - j + 1);
        if (pos > i) break;
        update(pos, -1);
      }
    } else {
      final[i] = A;
      update(i, 1);
    }
  }
  int ant = 0, pos;
  bool chosto = false;
  for (int i = 1; i <= N; i++) {
    pos = query(i);
    if (pos != ant) {
      ant = pos;
      printf("%d", final[i]);
      chosto = true;
    }
  }
  if (!chosto) printf("Poor stack!");
  printf("\n");
  return 0;
}
