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 inf = 2147483647;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar();
  return x * f;
}
int n, m, a[6], b[21], ans[6][21];
bool f[21][32][11][11][11][11][11];
vector<int> h[4];
int get(int x) {
  int re = (x & 1), last = -1;
  while (x) {
    if (last != -1 && (x & 1) != last && x & 1) re++;
    last = (x & 1), x >>= 1;
  }
  return re;
}
bool dfs(int m, int S, int p1, int p2, int p3, int p4, int p5) {
  if (p1 < 0 || p2 < 0 || p3 < 0 || p4 < 0 || p5 < 0) return false;
  if (f[m][S][p1][p2][p3][p4][p5]) return false;
  if (m == 1) {
    if ((S & 1) == p1 && ((S & 2) >> 1) == p2 && ((S & 4) >> 2) == p3 &&
        ((S & 8) >> 3) == p4 && ((S & 16) >> 4) == p5) {
      for (int i = 1; i <= 5; i++)
        if ((1 << (i - 1)) & S) ans[i][m] = 1;
      return true;
    }
    return false;
  }
  for (int i = 0; i < h[b[m - 1]].size(); i++) {
    int x = h[b[m - 1]][i], t1 = p1, t2 = p2, t3 = p3, t4 = p4, t5 = p5;
    if ((S & 1) && (!(x & 1))) t1--;
    if ((S & 2) && (!(x & 2))) t2--;
    if ((S & 4) && (!(x & 4))) t3--;
    if ((S & 8) && (!(x & 8))) t4--;
    if ((S & 16) && (!(x & 16))) t5--;
    if (dfs(m - 1, x, t1, t2, t3, t4, t5)) {
      for (int i = 1; i <= 5; i++)
        if ((1 << (i - 1)) & S) ans[i][m] = 1;
      return true;
    }
  }
  f[m][S][p1][p2][p3][p4][p5] = true;
  return false;
}
int main() {
  for (int i = 0; i < 32; i++) h[get(i)].push_back(i);
  n = read(), m = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  for (int i = n + 1; i <= 5; i++) a[i] = 0;
  for (int i = 1; i <= m; i++) b[i] = read();
  for (int i = 0; i < h[b[m]].size(); i++) {
    int x = h[b[m]][i];
    if (dfs(m, x, a[1], a[2], a[3], a[4], a[5])) {
      for (int j = 1; j <= n; j++) {
        for (int k = 1; k <= m; k++)
          if (ans[j][k])
            putchar('*');
          else
            putchar('.');
        puts("");
      }
      return 0;
    }
  }
}