Problem: Dima's spent much time thinking what present to give to Inna and gave her an empty sequence w. Now they want to fill sequence w with numbers zero and one. For that, they decided to play an amusing game. 

Before the game begins, Dima chooses m integers a1, a2, ..., am (1 ≤ a1 < a2 < ... < am). Then Inna and Dima start playing, that is, adding numbers to sequence w. Each new number they choose is added to the end of the sequence. At some moments of time Dima feels that the game is going to end too soon (and he wants to play with Inna as long as possible), so he hits a table hard with his fist. At that the a1-th, a2-th, a3-th, ..., ak-th numbers from the beginning simultaneously fall out of the sequence (the sequence gets k numbers less). Here k is such maximum number that value ak doesn't exceed the current length of the sequence. If number a1 is larger than the current length of w, then nothing falls out of the sequence.

You are given the chronological sequence of events in the game. Each event is either adding a number to the end of sequence w or Dima's hit on the table. Calculate the sequence w after all these events happen.

Input

The first line of the input contains two integers n and m (1 ≤ n, m ≤ 106) showing how many events took place and how many numbers Dima chose.

The next line contains m distinct integers ai (1 ≤ ai ≤ 106) sorted in the increasing order. 

Next n lines describe the events in the chronological order. Each line contains a single integer: -1, 0 or 1. Number -1 means that Dima hits the table. Number 0 means that Inna and Dima add number 0 to the end of the sequence. Number 1 means that Inna and Dima add number 1 to the end of the sequence.

Output

In a single line print a sequence of numbers 0 and 1 — the elements of the sequence after all events happen. Print the elements of the sequence in the order from the beginning to the end of the sequence.

If after all events the sequence ends up empty, print "Poor stack!".

Examples

Input

10 3
1 3 6
-1
1
1
0
0
-1
0
1
-1
1


Output

011


Input

2 1
1
1
-1


Output

Poor stack!

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
const double SQRT2 = 1.41421356237;
const double EPS = 1e-9;
const float SQRT2F = (float)SQRT2;
const int INF = 1e9;
const long long INF64 = 1e18;
template <class T>
T sqr(const T &x) {
  return x * x;
}
template <class T>
T min(const T &a, const T &b, const T &c) {
  return min(min(a, b), c);
}
template <class T>
T max(const T &a, const T &b, const T &c) {
  return max(max(a, b), c);
}
inline void yesno(bool y) { cout << (y ? "YES\n" : "NO\n"); }
inline void yes_stop(bool y) {
  if (y) {
    yesno(1);
    exit(0);
  }
}
inline void no_stop(bool y) {
  if (!y) {
    yesno(0);
    exit(0);
  }
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int sgn(int x) { return (x > 0) - (x < 0); }
template <class Container>
void print_container(ostream &os, Container c) {
  for (const auto &x : c) {
    os << x << " ";
  }
}
template <class It>
void print_range(ostream &os, It b, It e) {
  for (; b != e; ++b) {
    os << *b << " ";
  }
}
const int MAXN = 1e6 + 5;
int rand_expanded() {
  int ans = (rand() << 16) | rand();
  return ans;
}
struct DecartTree {
  int y;
  int l, r;
  int sz;
  int v;
};
DecartTree dt[MAXN];
int dt_nodes_i = 1;
int root = 0;
void dt_recount(int T) {
  if (T == 0) {
    return;
  }
  dt[T].sz = dt[dt[T].l].sz + dt[dt[T].r].sz + 1;
}
int dt_node(int a) {
  int i = dt_nodes_i++;
  dt[i].v = a;
  dt[i].y = rand_expanded();
  dt[i].l = dt[i].r = 0;
  dt[i].sz = 1;
  dt_recount(i);
  return i;
}
DecartTree &node(int i) { return dt[i]; }
int dt_merge(int a, int b) {
  if (a == 0) {
    return b;
  }
  if (b == 0) {
    return a;
  }
  if (dt[b].y > dt[a].y) {
    dt[b].l = dt_merge(a, dt[b].l);
    dt_recount(b);
    return b;
  } else {
    dt[a].r = dt_merge(dt[a].r, b);
    dt_recount(a);
    return a;
  }
}
void dt_print(int);
pair<int, int> dt_split(int T, int i) {
  if (T == 0) {
    return pair<int, int>(0, 0);
  }
  if (dt[dt[T].l].sz >= i) {
    pair<int, int> p = dt_split(dt[T].l, i);
    dt[T].l = p.second;
    dt_recount(T);
    return pair<int, int>(p.first, T);
  } else {
    pair<int, int> p = dt_split(dt[T].r, i - dt[dt[T].l].sz - 1);
    dt[T].r = p.first;
    dt_recount(T);
    return pair<int, int>(T, p.second);
  }
}
int dt_add(int T, int x) {
  int r = dt_node(x);
  return dt_merge(T, r);
}
int dt_del(int T, int a) {
  pair<int, int> p1 = dt_split(T, a);
  pair<int, int> p2 = dt_split(p1.second, 1);
  return dt_merge(p1.first, p2.second);
}
void dt_seq(int T) {
  if (T == 0) {
    return;
  }
  dt_seq(dt[T].l);
  cout << dt[T].v;
  dt_seq(dt[T].r);
}
int n, m, a[MAXN];
int main() {
  ios_base::sync_with_stdio(0);
  srand(1337);
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> a[i];
  }
  for (int z = 0; z < n; ++z) {
    int q;
    cin >> q;
    if (q < 0) {
      for (int i = 0; i < m; ++i) {
        if (a[i] - i > dt[root].sz) {
          break;
        }
        root = dt_del(root, a[i] - i - 1);
      }
    } else {
      root = dt_add(root, q);
    }
  }
  dt_seq(root);
  if (!root) cout << "Poor stack!";
  cout << "\n";
  return 0;
}