Problem: In this task you have to write a program dealing with nonograms on fields no larger than 5 × 20.

Simplified nonogram is a task where you have to build such field (each cell is either white or black) that satisfies the given information about rows and columns. For each row and each column the number of contiguous black segments is specified. 

For example if size of the field is n = 3, m = 5, аnd numbers of contiguous black segments in rows are: [2, 3, 2] and in columns are: [1, 0, 1, 2, 1] then the solution may look like:

<image>

It is guaranteed that on each test in the testset there exists at least one solution.

Input

In the first line there follow two integers n, m (1 ≤ n ≤ 5, 1 ≤ m ≤ 20) — number of rows and number of columns respectively.

Second line contains n integers a1, a2, ..., an where ai is the number of contiguous black segments in i-th row of the field. 

Similarly, third line contains m integers b1, b2, ..., bm where bi is the number of contiguous black segments in the i-th column of the field.

It is guaranteed that there exists at least one solution.

Output

Output any possible solution. Output should consist of n lines each containing m characters. Denote white cell as "." and black cell as "*".

Examples

Input

3 5
2 3 2
1 0 1 2 1


Output

*.**.
*.*.*
*..**

Input

3 3
2 1 2
2 1 2


Output

*.*
.*.
*.*


Input

3 3
1 0 1
2 2 2


Output

***
...
***

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5;
const int MAXM = 20;
const int C = 161051;
int N, M, col[MAXM], row[MAXN], precalc[1 << 5], ans[MAXM];
char dp[MAXM + 1][C + 1][1 << 5];
int push(int a, int b, int cnt, int dir) {
  int el = 1;
  for (int i = 0; i < 5; i++) {
    if (!(a & 1) && (b & 1)) cnt = cnt + dir * el;
    a >>= 1;
    b >>= 1;
    el *= 11;
  }
  return cnt;
}
void back(int m, int cnt, int mask1) {
  if (m == 0) return;
  ans[m - 1] = mask1;
  for (int mask2 = 0; mask2 < 1 << N; mask2++) {
    int precnt = push(mask2, mask1, cnt, -1);
    if (precnt < 0) continue;
    if (dp[m - 1][precnt][mask2]) {
      back(m - 1, precnt, mask2);
      break;
    }
  }
}
int main() {
  for (int i = 0; i < 1 << MAXN; i++) {
    int c = 0, prv = 0, ni = i;
    for (int j = 0; j < MAXN; j++, ni >>= 1) {
      int cur = ni & 1;
      if (cur && cur != prv) c++;
      prv = cur;
    }
    precalc[i] = c;
  }
  cin >> N >> M;
  for (int i = 0; i < N; i++) cin >> row[i];
  for (int i = 0; i < M; i++) cin >> col[i];
  dp[0][0][0] = 1;
  for (int i = 0; i < M; i++)
    for (int j = 0; j <= C; j++)
      for (int m1 = 0; m1 < 1 << N; m1++) {
        if (dp[i][j][m1] == 0) continue;
        for (int m2 = 0; m2 < 1 << N; m2++) {
          if (precalc[m2] != col[i]) continue;
          int npush = push(m1, m2, j, +1);
          if (npush <= C) dp[i + 1][npush][m2] = 1;
        }
      }
  int rc = 0, el = 1;
  for (int i = 0; i < N; i++, el *= 11) rc += row[i] * el;
  for (int m = 0; m < 1 << N; m++)
    if (dp[M][rc][m]) {
      back(M, rc, m);
      break;
    }
  int mask = 1;
  for (int i = 0; i < N; i++, mask <<= 1) {
    for (int j = 0; j < M; j++) {
      if (ans[j] & mask)
        cout << "*";
      else
        cout << ".";
    }
    cout << "\n";
  }
  return 0;
}