#include <bits/stdc++.h>
using namespace std;
const int N = 11, MSK = 1 << 5;
bool dp[N << 1][N][N][N][N][N][32];
char res[N][N << 1];
int n, m, a[N], b[N << 1], bl[32][32][6];
char par[N << 1][N][N][N][N][N][32], cntbl[32];
inline int calc(int msk) {
  int ted = 0;
  bool bb = 0;
  for (int i = 0; i < n; i++) {
    if (msk >> i & 1) {
      if (!bb) ted++;
      bb = 1;
    } else
      bb = 0;
  }
  return ted;
}
inline void init() {
  for (int msk = 0; msk < 1 << n; msk++) cntbl[msk] = calc(msk);
  for (int i = 0; i < 1 << n; i++)
    for (int j = 0; j < 1 << n; j++)
      for (int z = 0; z < n; z++)
        if ((i >> z & 1) && (j >> z & 1 ^ 1)) bl[i][j][z] = 1;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  for (int i = 0; i < m; i++) scanf("%d", b + i);
  init();
  memset(dp, 0, sizeof dp);
  dp[0][0][0][0][0][0][0] = 1;
  for (int c = 1; c <= m; c++)
    for (int i = 0; i <= a[0]; i++)
      for (int j = 0; j <= a[1]; j++)
        for (int k = 0; k <= a[2]; k++)
          for (int s = 0; s <= a[3]; s++)
            for (int t = 0; t <= a[4]; t++) {
              if ((i << 1) > c + 1 || (j << 1) > c + 1 || (k << 1) > c + 1 ||
                  (s << 1) > c + 1 || (t << 1) > c + 1)
                continue;
              for (int cur = 0; cur < (1 << n); cur++) {
                if (cntbl[cur] != b[c - 1]) continue;
                if (c == 1) {
                  if (bl[cur][0][0] <= i && bl[cur][0][1] <= j &&
                      bl[cur][0][2] <= k && bl[cur][0][3] <= s &&
                      bl[cur][0][4] <= t &&
                      dp[c - 1][i - bl[cur][0][0]][j - bl[cur][0][1]]
                        [k - bl[cur][0][2]][s - bl[cur][0][3]]
                        [t - bl[cur][0][4]][0]) {
                    dp[c][i][j][k][s][t][cur] = 1;
                  }
                } else {
                  for (int bef = 0; bef < (1 << n); bef++)
                    if (cntbl[bef] == b[c - 2]) {
                      if (bl[cur][bef][0] <= i && bl[cur][bef][1] <= j &&
                          bl[cur][bef][2] <= k && bl[cur][bef][3] <= s &&
                          bl[cur][bef][4] <= t &&
                          dp[c - 1][i - bl[cur][bef][0]][j - bl[cur][bef][1]]
                            [k - bl[cur][bef][2]][s - bl[cur][bef][3]]
                            [t - bl[cur][bef][4]][bef]) {
                        dp[c][i][j][k][s][t][cur] = 1;
                        par[c][i][j][k][s][t][cur] = bef;
                      }
                    }
                }
              }
            }
  int x[5], ansm = -1, col = m;
  for (int msk = 0; msk < (1 << n); msk++)
    if (dp[m][a[0]][a[1]][a[2]][a[3]][a[4]][msk]) {
      ansm = msk;
      break;
    }
  assert(ansm != -1);
  int bef;
  for (int i = 0; i < 5; i++) x[i] = a[i];
  while (col > 0) {
    bef = par[col][x[0]][x[1]][x[2]][x[3]][x[4]][ansm];
    for (int i = 0; i < n; i++) res[i][col - 1] = (ansm >> i & 1) ? '*' : '.';
    if (col == 1) break;
    for (int i = 0; i < 5; i++) x[i] -= bl[ansm][bef][i];
    ansm = bef;
    --col;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) printf("%c", res[i][j]);
    printf("\n");
  }
  return 0;
}
