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;
int N, M;
vector<int> nums[5];
int tt[21][5] = {};
int cnt[21][5] = {};
int numm[20];
int rows[5];
int cols[20];
int res[20];
char vis[22][22][22][22][22][22] = {};
int dfs(int k) {
  vector<int>::iterator it, end;
  char& viss = vis[k][cnt[k][0] << 1 | tt[k][0]][cnt[k][1] << 1 | tt[k][1]]
                  [cnt[k][2] << 1 | tt[k][2]][cnt[k][3] << 1 | tt[k][3]]
                  [cnt[k][4] << 1 | tt[k][4]];
  if (viss)
    return 0;
  else {
    viss = 1;
  }
  int i;
  int u;
  if (k == M) {
    memcpy(res, numm, sizeof(res));
    return 1;
  }
  it = nums[cols[k]].begin();
  end = nums[cols[k]].end();
  for (; it != end; ++it) {
    u = *it;
    numm[k] = u;
    for (i = 0; i < N; ++i) {
      if (u & (1 << i)) {
        tt[k + 1][i] = 1;
        if (!tt[k][i])
          cnt[k + 1][i] = cnt[k][i] + 1;
        else
          cnt[k + 1][i] = cnt[k][i];
      } else {
        tt[k + 1][i] = 0;
        cnt[k + 1][i] = cnt[k][i];
      }
      if (cnt[k + 1][i] > rows[i] || cnt[k + 1][i] + (M - k) / 2 < rows[i])
        break;
    }
    if (i != N) continue;
    if (dfs(k + 1)) return 1;
  }
  return 0;
}
int main() {
  int i;
  int k;
  int t = 0;
  int tcnt;
  cin >> N >> M;
  for (i = 0; i < N; ++i) cin >> rows[i];
  for (i = 0; i < M; ++i) cin >> cols[i];
  for (i = (1 << N) - 1; i >= 0; --i) {
    t = 0;
    tcnt = 0;
    k = i;
    while (k) {
      if (k & 1 && !t) {
        ++tcnt;
        t = 1;
      } else if (!(k & 1)) {
        t = 0;
      }
      k >>= 1;
    }
    nums[tcnt].push_back(i);
  }
  dfs(0);
  int j;
  for (i = 0; i < N; ++i) {
    for (j = 0; j < M; ++j) {
      if (res[j] & (1 << i))
        putchar('*');
      else
        putchar('.');
    }
    putchar('\n');
  }
  return 0;
}