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;
vector<int> a, b;
int n, m;
mt19937_64 rnd(time(NULL));
const double MIN_T = 1e-5;
const double MAX_T = 1000;
const int MAX_NUMBER_OF_MUTATIONS = 10;
const int INF = 1000000000;
vector<vector<int>> cur_ans, best_ans;
int best_cost;
void mutation(vector<vector<int>>& a) {
  int cnt = rnd() % MAX_NUMBER_OF_MUTATIONS + 1;
  for (; cnt; --cnt) {
    int x = rnd() % n;
    int y = rnd() % m;
    a[x][y] = rnd() % 2;
  }
}
int getCost(const vector<vector<int>>& cur) {
  int x = 0;
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    x = 0;
    for (int j = 0; j < m; ++j) {
      if ((cur[i][j] == 1) && ((j == 0) || (cur[i][j - 1] == 0))) {
        x++;
      }
    }
    ans += (x - a[i]) * (x - a[i]);
  }
  for (int i = 0; i < m; ++i) {
    x = 0;
    for (int j = 0; j < n; ++j) {
      if ((cur[j][i] == 1) && ((j == 0) || (cur[j - 1][i] == 0))) {
        x++;
      }
    }
    ans += (x - b[i]) * (x - b[i]);
  }
  return ans;
}
double getProbability(double dE, double t) { return exp(-dE / t); }
bool isTransition(double dE, double t) {
  if (dE < 0) {
    return true;
  }
  double x = getProbability(dE, t);
  x *= INF;
  return (rnd() % INF <= x);
}
void print(const string& file_name) {
  ofstream file_out(file_name);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      file_out << (best_ans[i][j] ? '*' : '.');
    }
    file_out << endl;
  }
  file_out.close();
}
void init(vector<vector<int>>& cur) {
  cur.assign(n, vector<int>(m));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cur[i][j] = rnd() % 2;
    }
  }
  best_ans = cur;
  best_cost = getCost(cur);
}
int main() {
  cin >> n >> m;
  a.resize(n);
  for (int& v : a) cin >> v;
  b.resize(m);
  for (int& v : b) cin >> v;
  init(cur_ans);
  double T = MAX_T;
  int i = 1;
  while ((T > MIN_T) && (best_cost != 0)) {
    mutation(cur_ans);
    int cur_cost = getCost(cur_ans);
    if (isTransition(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) {
      cout << (best_ans[i][j] ? '*' : '.');
    }
    cout << endl;
  }
  return 0;
}