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;
mt19937 rnd(time(NULL));
const int N = 25;
const int inf = 1e9;
const double MAX_T = 1000;
const double MIN_T = 1e-5;
const int max_mutations = 10;
int n, m;
vector<int> A, B;
vector<vector<int> > best_ans, cur_ans;
int best_cost = 0;
inline void mutation(vector<vector<int> > &a) {
  int cnt = rnd() % max_mutations + 1;
  for (; cnt; cnt--) {
    int x = rnd() % n, y = rnd() % m;
    a[x][y] = rnd() % 2;
  }
}
inline int calc(vector<vector<int> > &a) {
  int x = 0, res = 0;
  for (int i = 0; i < n; i++) {
    x = 0;
    for (int j = 0; j < m; j++) {
      if (a[i][j] == 1 && (j == 0 || a[i][j - 1] == 0)) x++;
    }
    res += (x - A[i]) * (x - A[i]);
  }
  for (int i = 0; i < m; i++) {
    x = 0;
    for (int j = 0; j < n; j++) {
      if (a[j][i] == 1 && (j == 0 || a[j - 1][i] == 0)) x++;
    }
    res += (x - B[i]) * (x - B[i]);
  }
  return res;
}
inline double ok(double E, double t) { return exp(-E / t); }
inline bool valid(double E, double t) {
  if (E < 0) return true;
  double x = ok(E, t);
  x *= inf;
  return (rnd() % inf <= x);
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  A.resize(n, 0);
  B.resize(m, 0);
  for (int i = 0; i < n; i++) cin >> A[i];
  for (int j = 0; j < m; j++) cin >> B[j];
  cur_ans.assign(n, vector<int>(m));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cur_ans[i][j] = rnd() % 2;
  best_ans = cur_ans;
  best_cost = calc(cur_ans);
  double T = MAX_T;
  int i = 1;
  while (T > MIN_T && best_cost != 0) {
    mutation(cur_ans);
    int cur_cost = calc(cur_ans);
    if (valid(cur_cost - best_cost, T)) {
      best_cost = min(best_cost, cur_cost);
      if (best_cost == cur_cost) best_ans = cur_ans;
    } else
      cur_ans = best_ans;
    T = MAX_T * 0.1 / i;
    i++;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (best_ans[i][j])
        cout << "*";
      else
        cout << ".";
    }
    cout << '\n';
  }
  return 0;
}