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, rn[5], cn[20];
vector<char> col[5];
vector<char> cur;
bool tryit[11][11][11][11][11][20][40];
void solve(const vector<char>& cur) {
  for (int j = 0; j < n; ++j) {
    for (int i = 0; i < m; ++i)
      if (cur[i] & (1 << j))
        printf("*");
      else
        printf(".");
    puts("");
  }
  exit(0);
}
void work(int k, char p, int r0, int r1, int r2, int r3, int r4) {
  if (k == m) {
    if (r0 || r1 || r2 || r3 || r4) return;
    solve(cur);
    return;
  }
  if (r0 < 0 || r1 < 0 || r2 < 0 || r3 < 0 || r4 < 0) return;
  if (tryit[r0][r1][r2][r3][r4][k][p]) return;
  tryit[r0][r1][r2][r3][r4][k][p] = true;
  for (char c : col[cn[k]]) {
    cur.push_back(c);
    work(k + 1, c, (r0) - ((((p ^ c) >> 0) & 1) && ((c >> 0) & 1)),
         (r1) - ((((p ^ c) >> 1) & 1) && ((c >> 1) & 1)),
         (r2) - ((((p ^ c) >> 2) & 1) && ((c >> 2) & 1)),
         (r3) - ((((p ^ c) >> 3) & 1) && ((c >> 3) & 1)),
         (r4) - ((((p ^ c) >> 4) & 1) && ((c >> 4) & 1)));
    cur.pop_back();
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) scanf("%d", rn + i);
  for (int i = 0; i < m; ++i) scanf("%d", cn + i);
  for (char c = 0; c < (1 << n); ++c) {
    int cnt = 0;
    for (int j = 0; j < n; ++j)
      if (c & (1 << j) && (!j || !(c & (1 << (j - 1))))) cnt++;
    col[cnt].push_back(c);
  }
  work(0, 0, rn[0], rn[1], rn[2], rn[3], rn[4]);
}