Problem: Note that the memory limit in this problem is less than usual.

Let's consider an array consisting of positive integers, some positions of which contain gaps.

We have a collection of numbers that can be used to fill the gaps. Each number from the given collection can be used at most once.

Your task is to determine such way of filling gaps that the longest increasing subsequence in the formed array has a maximum size.

Input

The first line contains a single integer n — the length of the array (1 ≤ n ≤ 105).

The second line contains n space-separated integers — the elements of the sequence. A gap is marked as "-1". The elements that are not gaps are positive integers not exceeding 109. It is guaranteed that the sequence contains 0 ≤ k ≤ 1000 gaps.

The third line contains a single positive integer m — the number of elements to fill the gaps (k ≤ m ≤ 105).

The fourth line contains m positive integers — the numbers to fill gaps. Each number is a positive integer not exceeding 109. Some numbers may be equal. 

Output

Print n space-separated numbers in a single line — the resulting sequence. If there are multiple possible answers, print any of them.

Examples

Input

3
1 2 3
1
10


Output

1 2 3 


Input

3
1 -1 3
3
1 2 3


Output

1 2 3 


Input

2
-1 2
2
2 4


Output

2 2 


Input

3
-1 -1 -1
5
1 1 1 1 2


Output

1 1 2 


Input

4
-1 -1 -1 2
4
1 1 2 2


Output

1 2 1 2 

Note

In the first sample there are no gaps, so the correct answer is the initial sequence.

In the second sample there is only one way to get an increasing subsequence of length 3.

In the third sample answer "4 2" would also be correct. Note that only strictly increasing subsequences are considered.

In the fifth sample the answer "1 1 1 2" is not considered correct, as number 1 can be used in replacing only two times.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
inline int Add(int x) { return x >= mod ? x - mod : x; }
inline void Add(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
inline int Sub(int x) { return x < 0 ? x + mod : x; }
inline void Sub(int &x, int y) { x = Sub(x - y); }
inline int Mul(int x, int y) { return (int)((unsigned long long)x * y % mod); }
inline int Mul(int x, int y, int z) {
  return (int)((unsigned long long)x * y % mod * z % mod);
}
int Pow(int x, int y) {
  int z = 1;
  for (; y; y >>= 1) {
    if (y & 1) z = Mul(z, x);
    x = Mul(x, x);
  }
  return z;
}
int Fix(int x) { return Sub(x % mod); }
int Inv(int x) { return Pow(x, mod - 2); }
template <class T>
inline void Max(T &x, T y) {
  if (y > x) x = y;
}
template <class T>
inline void Min(T &x, T y) {
  if (y < x) x = y;
}
const int maxn = 1e5, inf = ~0U >> 2;
int n, N, m, A[maxn + 2], A0[maxn + 2], B[maxn];
map<int, int> use;
int least[maxn + 3], l_who[maxn + 3];
int len[maxn + 2], last[maxn + 2];
int L[maxn + 2], R[maxn + 2];
int s_gap[maxn + 3];
void InitLR(void) {
  s_gap[0] = 0;
  for (int i = 0; i < N; ++i) {
    int x = A[i];
    s_gap[i + 1] = s_gap[i] + (x == -1);
    if (x == -1) continue;
    L[i] = (int)(upper_bound(B, B + m, x) - B);
    R[i] = (int)(lower_bound(B, B + m, x) - B - 1);
  }
}
inline int Count(int i, int j) { return R[j] - L[i] + 1; }
void Solve(void) {
  N = n + 2;
  least[0] = least[1] = A[0];
  l_who[0] = l_who[1] = 0;
  len[0] = 1;
  fill(least + 2, least + N + 1, inf);
  for (int i = 1; i < N; ++i) {
    if (A[i] != -1) {
      int d = (int)(lower_bound(least, least + N + 1, A[i]) - least);
      len[i] = d;
      last[i] = l_who[d - 1];
      least[d] = A[i];
      l_who[d] = i;
    } else {
      for (int j = m - 1, d = N; j >= 0; --j) {
        while (d > 0 && least[d - 1] >= B[j]) --d;
        least[d] = B[j];
        l_who[d] = -1;
      }
    }
  }
  InitLR();
  int pos = N - 1;
  while (pos > 0) {
    int pos_last = last[pos];
    if (pos_last != -1) {
      pos = pos_last;
      continue;
    }
    for (int i = 0; i < pos; ++i) {
      if (A[i] != -1 && A[i] < A[pos]) {
        int c_val = Count(i, pos), c_gap = s_gap[pos] - s_gap[i];
        if (L[i] <= R[pos] && min(c_val, c_gap) + 1 + len[i] == len[pos]) {
          int cur = L[i];
          for (int j = i + 1; j < pos; ++j) {
            if (A[j] == -1) {
              assert(cur >= L[i] && cur <= R[pos]);
              A[j] = B[cur++];
              if (cur > R[pos]) break;
            }
          }
          pos = i;
          break;
        }
      }
    }
  }
}
int Any(void) {
  auto x = use.begin();
  if (x->second == 0) {
    use.erase(x);
    return Any();
  }
  --x->second;
  return x->first;
}
int main(void) {
  scanf("%d", &n);
  A[0] = -2;
  A[n + 1] = inf - 1;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", A + i);
  }
  memcpy((A0), (A), sizeof((A)[0]) * (n + 2));
  scanf("%d", &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d", B + i);
    use[B[i]] += 1;
  }
  sort(B, B + m);
  m = (int)(unique(B, B + m) - B);
  Solve();
  for (int i = 1; i <= n; ++i) {
    if (A[i] != -1 && A0[i] == -1) {
      use[A[i]] -= 1;
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (A[i] == -1) {
      A[i] = Any();
    }
    printf("%d%c", A[i], " \n"[i == n]);
  }
  return 0;
}