#include <bits/stdc++.h>
using namespace std;
int seg(int msk) {
  if (!msk) return 0;
  int ret = 0, prev = 0;
  while (msk > 0) {
    int lst = msk & -msk;
    if (lst > (prev << 1)) ret++;
    prev = lst;
    msk -= lst;
  }
  return ret;
}
int N, M, req, a[6], b[21], mx = (1 << 5), cmp[32][32][5];
short dp[21][32][11][11][11][11][11];
char s[5][22];
vector<int> v[13];
int solve(int pos, int fr, int sc, int th, int fo, int fi) {
  if (fr < 0 || sc < 0 || th < 0 || fo < 0 || fi < 0) return -2;
  int p = 0;
  memset(dp, -1, sizeof(dp));
  dp[p][0][0][0][0][0][0] = 1;
  for (int iM = 1; iM < (int)pos + 1; iM++) {
    int imsk, prev;
    int nw = (p + 1) % 21;
    for (int i = 0; i < (int)mx; i++)
      for (int ifr = 0; ifr < (int)fr + 1; ifr++)
        for (int isc = 0; isc < (int)sc + 1; isc++)
          for (int ith = 0; ith < (int)th + 1; ith++)
            for (int ifo = 0; ifo < (int)fo + 1; ifo++)
              for (int ifi = 0; ifi < (int)fi + 1; ifi++)
                dp[nw][i][ifr][isc][ith][ifo][ifi] = -1;
    for (int j = 0; j < (int)v[b[iM - 1]].size(); j++)
      for (int ifr = 0; ifr < (int)fr + 1; ifr++)
        for (int isc = 0; isc < (int)sc + 1; isc++)
          for (int ith = 0; ith < (int)th + 1; ith++)
            for (int ifo = 0; ifo < (int)fo + 1; ifo++)
              for (int ifi = 0; ifi < (int)fi + 1; ifi++)
                for (int i = 0; i < (int)v[b[iM]].size(); i++) {
                  prev = v[b[iM - 1]][j];
                  imsk = v[b[iM]][i];
                  if (dp[p][prev][ifr][isc][ith][ifo][ifi] >= 0) {
                    if (ifr + cmp[prev][imsk][0] > 10 ||
                        isc + cmp[prev][imsk][1] > 10)
                      continue;
                    if (ith + cmp[prev][imsk][2] > 10 ||
                        ifo + cmp[prev][imsk][3] > 10)
                      continue;
                    if (ifi + cmp[prev][imsk][4] > 10) continue;
                    dp[nw][imsk][ifr + cmp[prev][imsk][0]]
                      [isc + cmp[prev][imsk][1]][ith + cmp[prev][imsk][2]]
                      [ifo + cmp[prev][imsk][3]][ifi + cmp[prev][imsk][4]] =
                          prev;
                  }
                }
    p = nw;
  }
  return p;
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 0; i < (int)N; i++) scanf("%d", &a[i + 1]);
  for (int i = 0; i < (int)M; i++) scanf("%d", &b[i + 1]);
  for (int i = 0; i < (int)mx; i++) v[seg(i)].push_back(i);
  for (int i = 0; i < (int)mx; i++)
    for (int j = 0; j < (int)mx; j++)
      for (int k = 0; k < (int)5; k++)
        cmp[i][j][k] = (!(i & (1 << k)) && (j & (1 << k))) ? 1 : 0;
  int nw, imsk, msk = -1, pos = M, val[5], ar[5];
  for (int i = 1; i < (int)6; i++) val[i - 1] = a[i];
  while (pos > 0) {
    nw = solve(pos, val[0], val[1], val[2], val[3], val[4]);
    if (msk == -1)
      for (int i = 0; i < (int)mx; i++)
        if (dp[nw][i][val[0]][val[1]][val[2]][val[3]][val[4]] >= 0) {
          msk = i;
          break;
        }
    for (int i = 0; i < (int)21; i++) {
      if (pos <= 0) break;
      imsk = dp[nw][msk][val[0]][val[1]][val[2]][val[3]][val[4]];
      for (int i = 0; i < (int)5; i++)
        s[i][pos - 1] = (msk & (1 << i)) ? '*' : '.';
      pos--;
      for (int i = 0; i < (int)5; i++) val[i] -= cmp[imsk][msk][i];
      msk = imsk;
      nw = (nw - 1 + 21) % 21;
    }
  }
  for (int i = 0; i < (int)N; i++) {
    for (int j = 0; j < (int)M; j++) putchar(s[i][j]);
    puts("");
  }
  return 0;
}
