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> ans;
int row[5], col[20];
vector<int> v[3];
bool vis[20][11][11][11][11][11][1 << 5];
bool solve(int x, int r1, int r2, int r3, int r4, int r5, int mask) {
  if (x == m) {
    if (r1 + r2 + r3 + r4 + r5) return false;
    return true;
  }
  bool &ret = vis[x][r1][r2][r3][r4][r5][mask];
  if (ret) return false;
  ret = true;
  int a[5];
  a[0] = r1, a[1] = r2, a[2] = r3, a[3] = r4, a[4] = r5;
  int h = col[x];
  for (int i = 0; i < v[h].size(); i++) {
    int b[5] = {0};
    int now = v[h][i];
    for (int j = 0; j < n; j++) b[j] = a[j];
    bool flag = true;
    for (int j = 0; j < n; j++) {
      if ((mask & (1 << j)) == 0 && now & (1 << j)) b[j]--;
      if (b[j] < 0) {
        flag = false;
        break;
      }
    }
    if (flag) {
      if (solve(x + 1, b[0], b[1], b[2], b[3], b[4], now)) {
        ans.push_back(now);
        return true;
      }
    }
  }
  return false;
}
int main() {
  scanf("%d", &n);
  ;
  scanf("%d", &m);
  ;
  for (int i = 0; i < n; i++) scanf("%d", &row[i]);
  ;
  for (int i = 0; i < m; i++) scanf("%d", &col[i]);
  ;
  for (int i = 0; i < 1 << n; i++) {
    int c = 0, pre = 0;
    for (int j = 0; j < n; j++) {
      if (i & (1 << j) && !pre) {
        pre = 1;
        c++;
      } else
        pre = bool(i & (1 << j));
    }
    v[c].push_back(i);
  }
  solve(0, row[0], row[1], row[2], row[3], row[4], 0);
  reverse(ans.begin(), ans.end());
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < ans.size(); j++) {
      if (ans[j] & (1 << i))
        cout << '*';
      else
        cout << '.';
    }
    cout << "\n";
  }
  return 0;
}