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;
template <class T>
inline void amin(T &a, const T &b) {
  if (a > b) a = b;
}
template <class T>
inline void amax(T &a, const T &b) {
  if (a < b) a = b;
}
int N, M, A[9], B[21];
char F[9][33];
vector<int> G[6];
int bs(int S) {
  bool prev = false;
  int cnt = 0;
  for (int i = 0, i_len = (N); i < i_len; ++i) {
    if (!prev && S & (1 << i)) cnt++;
    prev = (bool)(S & (1 << i));
  }
  return cnt;
}
int mem[161051][21];
bool rec(int col, const int S) {
  if (col == M) {
    for (int i = 0, i_len = (N); i < i_len; ++i)
      if (A[i]) return false;
    return true;
  }
  for (int i = 0, i_len = (N); i < i_len; ++i)
    if (A[i] < 0 || 2 * A[i] - 1 > M - col) return false;
  int st = 0;
  for (int i = 0, i_len = (N); i < i_len; ++i) st = st * 11 + A[i];
  if (mem[st][col] & (1u << S)) return false;
  mem[st][col] |= (1u << S);
  vector<int> v = G[B[col]];
  random_shuffle(v.begin(), v.end());
  for (__typeof((v).begin()) e = (v).begin(), e_end = (v).end(); e != e_end;
       ++e) {
    for (int i = 0, i_len = (N); i < i_len; ++i)
      if (~S & (1 << i) && *e & (1 << i)) A[i]--;
    if (rec(col + 1, *e)) {
      for (int i = 0, i_len = (N); i < i_len; ++i)
        F[i][col] = (*e & (1 << i) ? '*' : '.');
      return true;
    }
    for (int i = 0, i_len = (N); i < i_len; ++i)
      if (~S & (1 << i) && *e & (1 << i)) A[i]++;
  }
  return false;
}
void test() {
  N = 5;
  M = 20;
  for (int i = 0, i_len = (N); i < i_len; ++i)
    for (int j = 0, j_len = (M); j < j_len; ++j) F[i][j] = ".*"[rand() % 2];
  for (int i = 0, i_len = (N); i < i_len; ++i) {
    A[i] = 0;
    char p = '.';
    for (int j = 0, j_len = (M); j < j_len; ++j) {
      if (p == '.' && F[i][j] == '*') A[i]++;
      p = F[i][j];
    }
  }
  for (int j = 0, j_len = (M); j < j_len; ++j) {
    B[j] = 0;
    char p = '.';
    for (int i = 0, i_len = (N); i < i_len; ++i) {
      if (p == '.' && F[i][j] == '*') B[j]++;
      p = F[i][j];
    }
  }
  for (int i = 0, i_len = (N); i < i_len; ++i) fprintf(stderr, "%s\n", F[i]);
  fprintf(stderr, "--\n");
  memset(F, 0, sizeof F);
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 0, i_len = (N); i < i_len; ++i) scanf("%d", A + i);
  for (int i = 0, i_len = (M); i < i_len; ++i) scanf("%d", B + i);
  for (int S = 0, S_len = (1 << N); S < S_len; ++S) G[bs(S)].push_back(S);
  rec(0, 0);
  for (int i = 0, i_len = (N); i < i_len; ++i) puts(F[i]);
  return 0;
}