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;
vector<int> g[1 << 20];
int a[22], b[22], c[22], u[22];
int ff[22][22], flag;
set<int> ha[22][1 << 6];
void dfs(int p, int n, int m) {
  if (p == m) {
    if (flag) return;
    int f = 0;
    for (int i = 0; i < n; i++) {
      if (u[i] != a[i]) {
        f = 1;
        break;
      }
    }
    if (!f) {
      flag = 1;
    }
    return;
  }
  int k = (int)g[b[p]].size();
  int e[22];
  for (int j = 0; j < n; j++) {
    e[j] = u[j];
  }
  for (int i = 0; i < k; i++) {
    int f = 0;
    int w = 0;
    for (int j = 0; j < n; j++) {
      u[j] = e[j];
      ff[j][p] = (g[b[p]][i] >> j) & 1;
      if (p == 0) {
        if (ff[j][0] == 1) u[j] = 1;
      } else {
        if (ff[j][p] == 1) {
          if (ff[j][p - 1] == 0) u[j]++;
        }
      }
      w = w * 11 + u[j];
      if (u[j] > a[j] || u[j] + (m - p) / 2 < a[j]) {
        f = 1;
        break;
      }
    }
    if (!f) {
      if (ha[p][g[b[p]][i]].find(w) != ha[p][g[b[p]][i]].end()) {
        continue;
      }
      dfs(p + 1, n, m);
      if (flag) return;
      ha[p][g[b[p]][i]].insert(w);
    }
  }
}
int main() {
  int i, j, n, m;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < m; i++) {
    scanf("%d", &b[i]);
  }
  int p = 1 << n;
  for (i = 0; i < p; i++) {
    int k = 0, q;
    q = i;
    while (q > 0) {
      c[k++] = q & 1;
      q >>= 1;
    }
    int w = 0, j = 0;
    while (j < k) {
      if (c[j] == 0) {
        j++;
        continue;
      }
      w++;
      while (j < k - 1 && c[j] == c[j + 1]) j++;
      j++;
    }
    g[w].push_back(i);
  }
  dfs(0, n, m);
  if (flag) {
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        if (ff[i][j] == 0)
          printf(".");
        else
          printf("*");
      }
      printf("\n");
    }
  } else
    printf("-1\n");
}