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;
struct state {
  int comps[5], pre;
  inline bool operator==(const state& other) const {
    if (pre != other.pre) return false;
    for (int i = 0; i < N; i++)
      if (comps[i] != other.comps[i]) return false;
    return true;
  }
};
namespace std {
template <>
struct hash<state> {
  size_t operator()(const state& st) const {
    int ret = 0;
    for (int i = 0; i < N; i++) {
      ret *= 10;
      ret += st.comps[i];
    }
    return ret * 32 + st.pre;
  }
};
}  // namespace std
inline state transition(state st, int mask) {
  for (int i = 0; i < N; i++)
    if (!((st.pre >> i) & 1) && ((mask >> i) & 1)) st.comps[i]++;
  st.pre = mask;
  return st;
}
unordered_map<state, int> dp[20];
int A[5];
int B[20];
int cache[1 << 5];
char ans[5][20];
int get(int mask) {
  int last = 0;
  int ret = 0;
  for (int i = 0; i < N; i++) {
    if (((mask >> i) & 1) && last == 0) ret++;
    last = (mask >> i) & 1;
  }
  return ret;
}
int solve(int col, state cur) {
  if (col == M) {
    for (int i = 0; i < N; i++)
      if (cur.comps[i] != A[i]) return -1;
    return 0;
  }
  if (dp[col].count(cur)) return dp[col][cur];
  int& ret = dp[col][cur];
  ret = -1;
  for (int i = 0; i < (1 << N); i++)
    if (cache[i] == B[col]) {
      if (solve(col + 1, transition(cur, i)) != -1) {
        ret = i;
        break;
      }
    }
  return ret;
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 0; i < N; i++) scanf("%d", A + i);
  for (int i = 0; i < M; i++) scanf("%d", B + i);
  state initial;
  for (int i = 0; i < N; i++) initial.comps[i] = 0;
  initial.pre = 0;
  for (int i = 0; i < (1 << N); i++) cache[i] = get(i);
  assert(solve(0, initial) != -1);
  for (int i = 0; i < M; i++) {
    int cur = dp[i][initial];
    initial = transition(initial, dp[i][initial]);
    for (int j = 0; j < N; j++) {
      if ((cur >> j) & 1)
        ans[j][i] = '*';
      else
        ans[j][i] = '.';
    }
  }
  for (int i = 0; i < N; i++, putchar('\n'))
    for (int j = 0; j < M; j++) putchar(ans[i][j]);
  return 0;
}