#include <bits/stdc++.h>
using namespace std;
const int N = 6 * 6 * 6 * 6 * 6 * 32;
int pre[11][N], suf[11][N];
int n, m, A[23], B[23];
int ds[32], DLT[32][32];
char mp[33][33];
inline int calc(int x, int y) {
  int _ = 1, res = 0;
  for (int i = 0; i < n; ++i) {
    if (!(x >> i & 1) && (y >> i & 1)) res += _;
    _ *= 6;
  }
  return res;
}
void out1(int S, int l) {
  if (!l) return;
  int t = S & 31;
  for (int i = 0; i < n; ++i)
    if (t >> i & 1)
      mp[i + 1][l] = '*';
    else
      mp[i + 1][l] = '.';
  out1(pre[l][S], l - 1);
}
void out2(int S, int l) {
  if (!l) return;
  int t = S & 31;
  for (int i = 0; i < n; ++i)
    if (t >> i & 1)
      mp[i + 1][m - l + 1] = '*';
    else
      mp[i + 1][m - l + 1] = '.';
  out2(suf[l][S], l - 1);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%d", A + i);
  for (int i = 1; i <= m; ++i) scanf("%d", B + i);
  memset(pre, -1, sizeof pre);
  memset(suf, -1, sizeof suf);
  for (int t = 0; t < 1 << n; ++t) {
    int& f = ds[t];
    f = t & 1;
    for (int i = 1; i < n; ++i)
      if ((t >> i & 1) && !(t >> (i - 1) & 1)) ++f;
  }
  **pre = **suf = 0;
  for (int i = 0; i < 1 << n; ++i)
    for (int j = 0; j < 1 << n; ++j) DLT[i][j] = calc(i, j);
  for (int i = 1; i <= (m + 1) / 2; ++i) {
    for (int S = 0; S < N; ++S)
      if (pre[i - 1][S] != -1)
        for (int t = 0; t < 1 << n; ++t)
          if (ds[t] == B[i]) {
            int p = S >> 5, L = S & 31;
            int np = p + DLT[L][t];
            pre[i][np << 5 | t] = S;
          }
  }
  for (int i = 1; i <= m / 2; ++i) {
    for (int S = 0; S < N; ++S)
      if (suf[i - 1][S] != -1)
        for (int t = 0; t < 1 << n; ++t)
          if (ds[t] == B[m - i + 1]) {
            int p = S >> 5, L = S & 31;
            int np = p + DLT[L][t];
            suf[i][np << 5 | t] = S;
          }
  }
  for (int S = 0; S < N; ++S)
    if (pre[(m + 1) / 2][S] != -1) {
      int t = S >> 5, d = S & 31;
      int a[] = {A[1] - t % 6, A[2] - t / 6 % 6, A[3] - t / 36 % 6,
                 A[4] - t / 216 % 6, A[5] - t / 1296};
      for (int x = 0; x < 1 << n; ++x) {
        bool ok = 1;
        int b[] = {a[0], a[1], a[2], a[3], a[4]};
        for (int y = 0; y < n; ++y)
          if ((d >> y & 1) && (x >> y & 1)) ++b[y];
        for (int i = 0; i < n; ++i)
          if (b[i] < 0 || b[i] > 5) ok = 0;
        if (!ok) continue;
        int zt = (((b[4] * 6 + b[3]) * 6 + b[2]) * 6 + b[1]) * 6 + b[0];
        if (suf[m / 2][zt << 5 | x] != -1) {
          out1(S, (m + 1) / 2), out2(zt << 5 | x, m / 2);
          for (int i = 1; i <= n; ++i) puts(mp[i] + 1);
          return 0;
        }
      }
    }
  return 1;
}
