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;
const double PI = 3.141592653589793;
const int N = 20 + 5;
bool sign;
int n, m;
int r[N];
int w[N];
int f[N];
int ans[N];
int g[N];
int q[N];
bool v[21][32][170000];
int countg(int k) {
  int cnt = 0;
  bool pre, now;
  pre = false;
  for (int i = 0; i < n; i++) {
    now = (f[i] & k) > 0 ? true : false;
    if (!pre && now) cnt++;
    pre = now;
  }
  return cnt;
}
bool check(int k, int state) {
  int cnt, now;
  for (cnt = 1; cnt <= n; cnt++) {
    now = state % 11;
    if (now > r[cnt] || now + (m - k + 1) / 2 < r[cnt]) return false;
    state = state / 11;
  }
  return true;
}
void dfs(int k, int pre, int state) {
  if (k == m + 1) {
    sign = true;
    return;
  }
  if (sign) return;
  v[k - 1][pre][state] = true;
  int now;
  for (int i = 0; i < f[n]; i++)
    if (g[i] == w[k]) {
      now = state;
      for (int j = 0; j < n; j++) {
        if ((i & f[j]) > 0 && (pre & f[j]) == 0) {
          now += q[j];
        }
      }
      if (check(k, now) && (k == m + 1 || !v[k][i][now])) {
        ans[k] = i;
        dfs(k + 1, i, now);
      }
      if (sign) return;
    }
}
void init() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &r[i]);
  for (int i = 1; i <= m; i++) scanf("%d", &w[i]);
  f[0] = q[0] = 1;
  for (int i = 1; i <= n; i++) f[i] = f[i - 1] << 1, q[i] = q[i - 1] * 11;
  for (int i = 0; i < f[n]; i++) g[i] = countg(i);
}
void work() {
  dfs(1, 0, 0);
  if (sign) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++)
        if (f[i - 1] & ans[j])
          putchar('*');
        else
          putchar('.');
      putchar('\n');
    }
  }
}
int main() {
  init();
  work();
  return 0;
}