10 10
.L.....R..
.........U
..D....D..
.R......L.
....L.....
.........D
......U...
D....R....
...U......
........L.
 5 5
DD..D
.....
LU...
U...U
.UL.U
 1 1
U
 5 5
UD..L
RRD..
..RDD
UUL..
DDLRR
 19 23
U..U..R........L...D...
.D.....UL.U.U........DR
..D.U..D....L......R...
D.......RL.L....D.....R
U..D.....U...U.L..D...U
...........L...........
U....U....D.U......LRR.
......RL...U...L.......
DLU..U......UU.U.U.D...
...........D....U......
U...DL......LL.....R...
...U..DD..........LD...
.R.........D.....UU...U
....D......R..........D
.L..........R.....L....
.R........L.LL....R....
..R...D........R....D..
.LR.R..LDU.DDRL......U.
...LL.....D.....DD.....
 11 29
URRUUDDLURLRDDLLRLDUDR.UDLLD.
LRRUDLUDLDULUDL.DURDRR.RRLLRR
D.DUDDURLRDDULDUDDUDDURRDLD.L
.RULURURRDLRRRLUUUU.RDLDLRRRL
.RLDDU.UUULUURURRLLUU.RLDRDUD
LRL.URRRDDURUURUDRRDLDDULRDRL
RLULDU.LRDUDRLDLRDDDDRUUDRDLL
DLUDURRDDUDLLDLLUURLDRUURRLUL
L.RRURRDDRRURRRDDUDRRDULR.LUR
LDLRULURRUULRDUUULLU.LLU.LLLL
DUURDULDDUDLRUUDRUULURLD.RL.U
 2 2
RD
UL
 1 10
LLLLLRRRRR
 3 3
...
...
..R
 17 13
...LD.UR.RUU.
LDLULDUDRRDRL
DD.RRLRUR.UD.
RU...D...LD..
.UR.R...URUUD
.RURD.RLR.D.R
.UUU.RU...UR.
UUUU.R.......
RL.LRU.UD.DUD
LD.DRURRLRDRL
.DR..UULUDDR.
LRLURRUUDDLUR
.LRDDLLR.L.DU
DRUDLLD.LRRU.
..DL.UDL.DUL.
U.DL..D..U.RD
RR.R...RL.L..

2 2
 4 1
 1 1
 8 3
 9 1
 94 1
 4 4
 5 2
 1 1
 24 2

#include <bits/stdc++.h>
using namespace std;
struct segment_tree {
  int n, pow2;
  int *A;
  segment_tree(int _n) {
    n = _n;
    pow2 = 1;
    while (pow2 < n) pow2 <<= 1;
    A = new int[pow2 << 1];
    for (int i = 0; i < 2 * pow2; i++) A[i] = 0;
  }
  void update(int ind, int val) {
    ind += pow2;
    A[ind] = val;
    while (ind > 1) {
      ind >>= 1;
      A[ind] = A[ind << 1] + A[(ind << 1) + 1];
    }
  }
  int smallest_ind(int val) {
    int ind = 1;
    int LB = 0, RB = pow2 - 1, MB;
    int accum_left = 0;
    while (RB != LB) {
      MB = (LB + RB) >> 1;
      if (MB + accum_left + A[ind << 1] >= val) {
        ind = ind << 1;
        RB = MB;
      } else {
        accum_left += A[ind << 1];
        ind = (ind << 1) + 1;
        LB = MB + 1;
      }
    }
    return LB;
  }
  ~segment_tree() { delete[] A; }
};
const int MX = 1000 * 1000 + 9;
int n, m;
int a[MX];
int ans_str[MX];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    a[i]--;
  }
  vector<int> ans;
  int sz = 0;
  segment_tree T(2 * MX);
  int curr;
  for (int i = 0; i < n; i++) {
    cin >> curr;
    if (curr != -1) {
      ans_str[sz] = curr;
      sz++;
    } else {
      vector<int> found_positions;
      int iter_i = 0;
      while (iter_i < m) {
        int curr = a[iter_i];
        int pos = T.smallest_ind(curr);
        if (pos < sz) {
          found_positions.push_back(pos);
          iter_i++;
        } else
          break;
      }
      for (size_t j = 0; j < found_positions.size(); j++)
        T.update(found_positions[j], -1);
    }
  }
  int p2 = T.pow2;
  for (int i = 0; i < sz; i++) {
    if (T.A[p2 + i] != -1) ans.push_back(ans_str[i]);
  }
  if (ans.size() == 0)
    cout << "Poor stack!";
  else {
    for (size_t i = 0; i < ans.size(); i++) cout << ans[i];
  }
  return 0;
}
