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>
#pragma comment(linker, ”/ STACK : 256000000“)
using namespace std;
inline void fr(int &to) {
  char t = getchar();
  to ^= to;
  while (t > 47) {
    to = (to << 3) + (to << 1) + t - 48;
    t = getchar();
  }
}
void fw(int what) {
  if (what > 9) fw(what / 10);
  putchar(what % 10 + 48);
}
int n, m, a[30], b[30];
int ans_f = 2e9, aans[30], bans[30];
char ans_table[30][30];
long double T = 1000;
mt19937 rnd(time(0));
inline void input() {
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= m; ++i) cin >> b[i];
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) ans_table[i][j] = '.';
}
inline void output() {
  for (int i = 1; i <= n; ++i, cout << '\n')
    for (int j = 1; j <= m; ++j) cout << ans_table[i][j];
}
inline int Temp(int delta) {
  long double gen = rnd() / 4294967295.0l;
  int ret = gen <= exp(-(delta / T));
  T *= 0.995;
  return ret;
}
inline void solve() {
  int now_f = 0, anow[30] = {}, bnow[30] = {};
  char now_table[30][30];
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) now_table[i][j] = ans_table[i][j];
  int index1 = rnd() % n + 1;
  int index2 = rnd() % m + 1;
  if (now_table[index1][index2] == '.')
    now_table[index1][index2] = '*';
  else
    now_table[index1][index2] = '.';
  for (int i = 1; i <= n; ++i)
    for (int j = 1, cnt = 0; j <= m + 1; ++j)
      if (now_table[i][j] == '*')
        cnt++;
      else if (cnt)
        anow[i]++, cnt = 0;
  for (int j = 1; j <= m; ++j)
    for (int i = 1, cnt = 0; i <= n + 1; ++i)
      if (now_table[i][j] == '*')
        cnt++;
      else if (cnt)
        bnow[j]++, cnt = 0;
  for (int i = 1; i <= n; ++i) now_f += pow(a[i] - anow[i], 2);
  for (int i = 1; i <= m; ++i) now_f += pow(b[i] - bnow[i], 2);
  if (now_f < ans_f) {
    ans_f = now_f;
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= m; ++j) ans_table[i][j] = now_table[i][j];
    for (int i = 1; i <= n; ++i) aans[i] = anow[i];
    for (int i = 1; i <= m; ++i) bans[i] = bnow[i];
  } else if (Temp(now_f - ans_f)) {
    ans_f = now_f;
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= m; ++j) ans_table[i][j] = now_table[i][j];
    for (int i = 1; i <= n; ++i) aans[i] = anow[i];
    for (int i = 1; i <= m; ++i) bans[i] = bnow[i];
  }
}
int main() {
  input();
  while (ans_f) solve();
  output();
}