#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:64000000")
const int infi = 1e9 + 7;
const long long infl = 1e18;
const long double eps = 1e-8;
const long double eps1 = 1e-10;
const int mod = (1e9 + 7);
const long long mod2 = 1e9 + 9;
const long long p1 = 31;
const long long p2 = 37;
const long long p3 = 29;
const int ver1 = (62 * 62);
const int maxm = 10000;
const int maxx = 1e9, maxy = 1e9;
vector<int> mask1[4];
int n, m;
void gen1(int mask, int i, int q) {
  if (i == n) {
    mask1[q].push_back(mask);
    return;
  }
  if (i && (mask & (1 << (i - 1)))) {
    gen1(mask | (1 << i), i + 1, q);
  } else {
    gen1(mask | (1 << i), i + 1, q + 1);
  }
  gen1(mask, i + 1, q);
  return;
}
int mod1[5];
int ar[5];
int arz[21];
char dp[21][32][11][11][11][11][11];
char p[21][32][11][11][11][11][11];
int ans1[30][30];
int main() {
  cin >> n >> m;
  gen1(0, 0, 0);
  for (int i = 0; i < n; ++i) {
    cin >> ar[i];
  }
  for (int i = 1; i <= m; ++i) {
    cin >> arz[i];
  }
  dp[0][0][ar[0]][ar[1]][ar[2]][ar[3]][ar[4]] = 1;
  for (int i = 1; i <= m; ++i) {
    for (int z = 0; z < (int)mask1[arz[i]].size(); ++z) {
      for (int x = 0; x < (int)mask1[arz[i - 1]].size(); ++x) {
        int maskl = mask1[arz[i - 1]][x];
        int maskr = mask1[arz[i]][z];
        memset(mod1, 0, sizeof mod1);
        for (int i = 0; i < n; ++i) {
          if (!(maskl & (1 << i)) && (maskr & (1 << i))) {
            ++mod1[i];
          }
        }
        int flag = 0;
        for (int q = 0; q + mod1[0] <= ar[0]; ++q) {
          for (int w = 0; w + mod1[1] <= ar[1]; ++w) {
            for (int e = 0; e + mod1[2] <= ar[2]; ++e) {
              for (int r = 0; r + mod1[3] <= ar[3]; ++r) {
                for (int t = 0; t + mod1[4] <= ar[4]; ++t) {
                  if (dp[i - 1][maskl][q + mod1[0]][w + mod1[1]][e + mod1[2]]
                        [r + mod1[3]][t + mod1[4]]) {
                    dp[i][maskr][q][w][e][r][t] = flag = 1;
                    p[i][maskr][q][w][e][r][t] = maskl;
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  int mask;
  for (int i = 0; i < (int)mask1[arz[m]].size(); ++i) {
    mask = mask1[arz[m]][i];
    if (dp[m][mask][0][0][0][0][0]) {
      break;
    }
  }
  vector<int> ans;
  int q, w, e, r, t;
  q = w = e = r = t = 0;
  for (int i = m; i; --i) {
    ans.push_back(mask);
    int nmask = p[i][mask][q][w][e][r][t];
    for (int j = 0; j < n; ++j) {
      if ((mask & (1 << j)) && !(nmask & (1 << j))) {
        if (j == 0) {
          ++q;
        }
        if (j == 1) {
          ++w;
        }
        if (j == 2) {
          ++e;
        }
        if (j == 3) {
          ++r;
        }
        if (j == 4) {
          ++t;
        }
      }
    }
    mask = nmask;
  }
  reverse(ans.begin(), ans.end());
  for (int i = 0; i < (int)ans.size(); ++i) {
    for (int j = 0; j < n; ++j) {
      if (ans[i] & (1 << j)) {
        ans1[i][j] = 1;
      }
    }
  }
  for (int j = 0; j < n; ++j) {
    for (int i = 0; i < m; ++i) {
      if (ans1[i][j]) {
        cout << '*';
      } else {
        cout << '.';
      }
    }
    cout << endl;
  }
  return 0;
}
