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;
#pragma comment(linker, "/STACK:36777216")
const int Direction[4][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
const int Nmax = 200100;
const int MANUAL =
    12 + 11 * 10 + 11 * 11 * 10 + 11 * 11 * 11 * 10 + 121 * 121 * 10;
int a[20];
int lim[25];
vector<int> MASKS[20];
int n, m;
int ans[25];
bool mem[22][33][MANUAL];
inline int modify(int a, int mask, int cont, int sign = 1) {
  int b = 0;
  int temp = 1;
  for (int i = 1; i <= n; i++) {
    int y = (((mask >> i - 1) & 1)) * sign * (1 - ((cont >> i - 1) & 1));
    int dg = (a % 11) + y;
    a /= 11;
    if (dg < 0) return -1;
    b = (b + dg * temp);
    temp *= 11;
  }
  return b;
}
void print();
inline bool check(int a, int remain) {
  remain = (remain + 1) / 2;
  for (int i = 1; i <= n; i++) {
    int x = a % 11;
    a /= 11;
    if (x > remain) return 0;
  }
  return 1;
}
void f(int step, int a, int cont) {
  assert(step < 22 && cont < 32);
  if (mem[step][cont][a]) return;
  mem[step][cont][a] = 1;
  if (!check(a, m - step + 1)) return;
  if (step == m + 1) {
    int x = a;
    if (x > 0) return;
    print();
  }
  int sz = MASKS[lim[step]].size();
  for (int i = 0; i < sz; i++) {
    int mask = MASKS[lim[step]][i];
    int b = modify(a, mask, cont, -1);
    if (b != -1) {
      ans[step] = mask;
      f(step + 1, b, mask);
    }
  }
}
void print() {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cout << ((((ans[j] >> i - 1) & 1) == 1) ? '*' : '.');
    }
    cout << endl;
  }
  cin.get();
  cin.get();
  ;
  exit(0);
}
int main() {
  srand(31415);
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (int mask = 0; mask < (1 << n); mask++) {
    int x = 0;
    for (int i = 0; i < n; i++) {
      if (((mask >> i) & 1) && (i == 0 || !((mask >> i - 1) & 1))) x++;
    }
    MASKS[x].push_back(mask);
  }
  for (int i = 0; i <= 5; i++) random_shuffle(MASKS[i].begin(), MASKS[i].end());
  for (int i = 1; i <= n; i++) cin >> a[i];
  int temp = 1;
  int A = 0;
  for (int i = 1; i <= n; i++) {
    A += temp * (a[i]);
    temp *= 11;
  }
  assert(A < MANUAL);
  for (int i = 1; i <= m; i++) cin >> lim[i];
  f(1, A, 0);
  cout << "So sad\n";
  return 0;
}