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;
template <class P, class Q>
inline void smin(P &a, Q b) {
  if (b < a) a = b;
}
template <class P, class Q>
inline void smax(P &a, Q b) {
  if (a < b) a = b;
}
const int maxn = 22;
int n, m;
int a[maxn], b[maxn];
set<pair<int, vector<int>>> mark;
char s[maxn][maxn];
void go(int col, vector<int> v) {
  for (int i = 0, _n = (int)(n); i < _n; i++)
    if (v[i] > 2 * a[i] || (m - col + 1) < 2 * a[i] - v[i]) return;
  if (col == m) {
    for (int i = 0, _n = (int)(n); i < _n; i++)
      if (v[i] + 1 < 2 * a[i]) return;
    throw 0;
  }
  if (mark.find(make_pair(col, v)) != mark.end()) return;
  mark.insert(make_pair(col, v));
  vector<int> t;
  for (int mask = 0, _n = (int)(1 << n); mask < _n; mask++) {
    int cnt = 0, tmp = mask;
    while (tmp) tmp &= tmp + (tmp & -tmp), cnt++;
    if (cnt != b[col]) continue;
    t = v;
    for (int i = 0, _n = (int)(n); i < _n; i++) {
      s[i][col] = (mask >> i & 1) ? '*' : '.';
      while (t[i] % 2 != (mask >> i & 1)) t[i]++;
    }
    go(col + 1, t);
    for (int i = 0, _n = (int)(n); i < _n; i++) {
      s[i][col] = 'X';
      while (t[i] % 2 != (mask >> i & 1)) t[i]++;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0, _n = (int)(n); i < _n; i++) cin >> a[i];
  for (int i = 0, _n = (int)(m); i < _n; i++) cin >> b[i];
  for (int i = 0, _n = (int)(n); i < _n; i++)
    for (int j = 0, _n = (int)(m); j < _n; j++) s[i][j] = 'X';
  try {
    go(0, vector<int>(n, 0));
  } catch (...) {
  };
  for (int i = 0, _n = (int)(n); i < _n; i++) cout << s[i] << endl;
  return 0;
}