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;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const ll inf = 1;
const ll mod = 1E9;
int r, c;
int tmpr[7];
int row[7];
int col[25];
bool vis[21][(1 << 5) + 1][11][11][11][11][11];
char mat[6][21];
vector<int> store[10];
bool flag = false;
void solve(int cnow, int pmask, int r1, int r2, int r3, int r4, int r5) {
  if (r1 < 0 || r2 < 0 || r3 < 0 || r4 < 0 || r5 < 0) return;
  if (flag) return;
  if (vis[cnow][pmask][r1][r2][r3][r4][r5]) return;
  vis[cnow][pmask][r1][r2][r3][r4][r5] = true;
  if (cnow == c) {
    if (r1 + r2 + r3 + r4 + r5 == 0) {
      for (int i = 0; i < r; i++) {
        for (int j = 0; j < c; j++) {
          printf("%c", mat[i][j]);
        }
        printf("\n");
      }
      flag = true;
    }
    return;
  }
  for (int i = 0; i < (int)store[col[cnow]].size(); i++) {
    int nmask = store[col[cnow]][i];
    tmpr[0] = r1;
    tmpr[1] = r2;
    tmpr[2] = r3;
    tmpr[3] = r4;
    tmpr[4] = r5;
    for (int j = 0; j < r; j++) {
      if (!(pmask & (1 << j)) && (nmask & (1 << j))) {
        tmpr[j]--;
      }
    }
    for (int j = 0; j < r; j++) {
      mat[j][cnow] = (nmask & (1 << j)) ? '*' : '.';
    }
    solve(cnow + 1, nmask, tmpr[0], tmpr[1], tmpr[2], tmpr[3], tmpr[4]);
    if (flag) return;
  }
  return;
}
int calc(int mask) {
  int pre = 0, ans = 0;
  for (int i = 0; i < r; i++) {
    if (pre == 0 && (mask & (1 << i))) {
      ans++;
    }
    pre = (mask & (1 << i));
  }
  return ans;
}
int main() {
  scanf("%d %d", &r, &c);
  for (int i = 0; i < r; i++) scanf("%d", &row[i]);
  for (int i = 0; i < c; i++) scanf("%d", &col[i]);
  int lim = (1 << r);
  for (int mask = 0; mask < lim; mask++) {
    store[calc(mask)].push_back(mask);
  }
  solve(0, 0, row[0], row[1], row[2], row[3], row[4]);
  return 0;
}