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;
int A[10], B[25];
string C[7];
vector<vector<int> > adj;
bool done;
bool mem[20][11][11][11][11][11][(1 << 5) + 1];
bool rec(int col, int c1, int c2, int c3, int c4, int c5, int mask) {
  if (col == m) {
    if (!c1 && !c2 && !c3 && !c4 && !c5) return true;
    return false;
  }
  bool &temp = mem[col][c1][c2][c3][c4][c5][mask];
  if (temp) return false;
  temp = true;
  int index = B[col];
  int D[5];
  for (int i = 0; i < adj[index].size(); ++i) {
    D[4] = c1;
    D[3] = c2;
    D[2] = c3;
    D[1] = c4;
    D[0] = c5;
    for (int j = 0; j < 5; ++j)
      if (((!(mask & (1 << j))) && (adj[index][i] & (1 << j)))) --D[j];
    if (D[0] > -1 && D[1] > -1 && D[2] > -1 && D[3] > -1 && D[4] > -1)
      if (rec(col + 1, D[4], D[3], D[2], D[1], D[0], adj[index][i])) {
        for (int j = 0; j < n; ++j)
          if ((adj[index][i] & (1 << j))) C[j][col] = '*';
        return true;
      }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; ++i) cin >> A[i];
  for (int i = 0; i < m; ++i) cin >> B[i];
  adj.resize(7);
  for (int i = 0; i < (1 << n); ++i) {
    int con = 0;
    bool prev = 0;
    for (int j = 0; j < n; ++j) {
      if (i & (1 << j) && (!prev)) ++con;
      prev = i & (1 << j);
    }
    adj[con].push_back(i);
  }
  for (int i = 0; i < m; ++i) C[0] += '.';
  for (int i = 1; i < n; ++i) C[i] = C[0];
  memset(mem, 0, sizeof(mem));
  rec(0, A[4], A[3], A[2], A[1], A[0], 0);
  for (int i = 0; i < n; ++i) cout << C[i] << endl;
  return 0;
}