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 int MAXN = 25, MAXH = 2e5, P = 11;
vector<int> S[MAXN];
int Max, N, M, Ans[MAXN], A[MAXN], B[MAXN];
bool Get, Flag[MAXN][MAXH][MAXN * 2];
int GetNum(int Num) {
  bool Flag = 0;
  int Ans = 0;
  for (int i = 0; i < N; i++) {
    if ((Num >> i) & 1) {
      if (!Flag) ++Ans;
      Flag = 1;
    } else
      Flag = 0;
  }
  return Ans;
}
void Prepare() {
  Max = 1 << N;
  for (int i = 0; i < Max; i++) S[GetNum(i)].push_back(i);
}
bool Check(int Hash) {
  for (int i = 1; i <= N; i++, Hash /= P)
    if (Hash % P != A[i]) return 0;
  return 1;
}
bool Impossible(int Now, int Hash) {
  for (int i = 1; i <= N; i++, Hash /= P) {
    int Num = Hash % P;
    if (Num > A[i]) return 1;
    if (Num + (M - Now + 2) / 2 < A[i]) return 1;
  }
  return 0;
}
int NewHash(int Hash, int Pre, int Now) {
  int New = 0;
  static int D[MAXN];
  for (int i = 0; i < N; i++, Hash /= P)
    D[i] = Hash % P + (((Pre >> i) & 1) == 0 && ((Now >> i) & 1) == 1);
  for (int i = N - 1; i + 1; i--) New = New * P + D[i];
  return New;
}
void Printf() {
  for (int i = 0; i < N; i++) {
    for (int j = 1; j <= M; j++) printf("%c", ((Ans[j] >> i) & 1) ? '*' : '.');
    printf("\n");
  }
}
void Solve(int Now, int Hash, int Pre) {
  if (Flag[Now][Hash][Pre]) return;
  Flag[Now][Hash][Pre] = 1;
  if (Now > M) {
    if (Check(Hash)) {
      Get = 1;
      Printf();
    }
    return;
  }
  if (Impossible(Now, Hash)) return;
  for (int i = 0; i < S[B[Now]].size(); i++) {
    Ans[Now] = S[B[Now]][i];
    Solve(Now + 1, NewHash(Hash, Pre, Ans[Now]), Ans[Now]);
    if (Get) return;
  }
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= N; i++) scanf("%d", &A[i]);
  for (int i = 1; i <= M; i++) scanf("%d", &B[i]);
  Prepare();
  Get = 0;
  Solve(1, 0, 0);
}