#include <bits/stdc++.h>
using namespace std;
const int Nmax = 7, Mmax = 25, Confmax = 161051 + 10, Smax = 16;
vector<int> confs[4];
int Rows[Nmax], Cols[Mmax];
int matrix[Mmax];
bitset<Confmax> dp[2][Smax];
char next1[Mmax][Smax][Confmax];
int canSub[35][Confmax];
int countSecvs(int x) {
  int pos = 0, ret = 0;
  while (pos < 5) {
    if ((x & (1 << pos)) == 0)
      ++pos;
    else {
      int cpos = pos;
      while ((x & (1 << pos)) != 0) ++pos;
      ret++;
    }
  }
  return ret;
}
int powsR[Nmax];
int substrr[1 << 5][1 << 5];
char Ans[Nmax][Mmax];
int main() {
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  for (int conf = 0; conf < (1 << N); ++conf) {
    confs[countSecvs(conf)].push_back(conf);
  }
  for (int i = 0; i < N; ++i) cin >> Rows[i];
  for (int i = 1; i <= M; ++i) cin >> Cols[i];
  int rmax = (M + 1) / 2 + 1, maxC = pow((double)rmax, N);
  powsR[0] = 1;
  for (int i = 1; i <= N; ++i) powsR[i] = powsR[i - 1] * rmax;
  int fconf = 0;
  for (int i = N - 1; i >= 0; --i) fconf = fconf * rmax + Rows[i];
  dp[0][0][0] = true;
  for (int conf = 0; conf < maxC; ++conf) {
    for (int nconf = 0; nconf < (1 << N); ++nconf) {
      for (int i = 0; i < N; ++i) {
        if ((1 << i) & nconf) {
          if (conf / powsR[i] % rmax == 0) {
            canSub[nconf][conf] = -1;
            break;
          } else {
            canSub[nconf][conf] += powsR[i];
          }
        }
      }
    }
  }
  for (int i = 1, u = 1; i <= M; ++i, u ^= 1) {
    for (int j = 0; j < Smax; ++j) dp[u][j].reset();
    for (int j = 0; j < int(confs[Cols[i]].size()); ++j) {
      int cconf = confs[Cols[i]][j];
      for (int conf = 0; conf < maxC; ++conf) {
        for (int k = 0; k < int(confs[Cols[i - 1]].size()); ++k) {
          int pconf = confs[Cols[i - 1]][k];
          pconf = cconf & ~pconf;
          if (canSub[pconf][conf] == -1) continue;
          int prevconf = conf - canSub[pconf][conf];
          if (dp[u ^ 1][k][prevconf]) {
            dp[u][j][conf] = true;
            next1[i][j][conf] = (char)k;
            break;
          }
        }
      }
    }
  }
  int uf = M & 1;
  int lasts;
  for (lasts = 0; !dp[uf][lasts][fconf]; ++lasts)
    ;
  for (int i = M, conf = fconf; i > 0; --i) {
    int rc = confs[Cols[i]][lasts];
    for (int j = 0; j < N; ++j) {
      if ((1 << j) & rc)
        Ans[j][i] = '*';
      else
        Ans[j][i] = '.';
    }
    int nx = next1[i][lasts][conf], pc = confs[Cols[i - 1]][nx];
    for (int j = 0; j < N; ++j) {
      if (((1 << j) & rc) && !((1 << j) & pc)) conf -= powsR[j];
    }
    lasts = nx;
  }
  for (int i = 0; i < N; ++i) cout << (Ans[i] + 1) << '\n';
}
