#include <bits/stdc++.h>
using namespace std;
const int maxN = 130 * 1000 + 5;
const int mod = 1000 * 1000 * 1000 + 7;
short dp[21][32][maxN];
int mas[maxN];
int ss[6][maxN];
int a[20], b[20];
vector<int> v[6];
int c[20], d[20];
int n, m;
char ans[20][20];
int p;
void solve(int lev, int mask, int state) {
  if (lev == 0) return;
  int tmp = state;
  for (int z = 0; z < n; z++) {
    c[z] = tmp % p;
    tmp /= p;
  }
  int smask = dp[lev][mask][state];
  for (int j = 0; j < n; j++) {
    d[j] = c[j];
    if ((mask >> j & 1) != (smask >> j & 1)) {
      if (mask >> j & 1) d[j]--;
    }
  }
  int sstate = 0;
  for (int j = n - 1; j >= 0; j--) sstate *= p, sstate += d[j];
  solve(lev - 1, smask, sstate);
  for (int i = 0; i < n; i++) ans[i][lev - 1] = ((mask >> i & 1) ? '*' : '.');
}
int tof[32][32], tofm[32][32];
int main() {
  ios::sync_with_stdio(0);
  cin.tie();
  memset(dp, -1, sizeof dp);
  cin >> n >> m;
  for (int mask = 0; mask < (1 << n); mask++) {
    int bef = 0, st = 0;
    for (int i = 0; i < n; i++)
      if (mask >> i & 1) {
        if (bef == 0) st++;
        bef = 1;
      } else
        bef = 0;
    v[st].push_back(mask);
  }
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  p = *max_element(a, a + n);
  p++;
  int stat = 0;
  for (int i = n - 1; i >= 0; i--) stat *= p, stat += a[i];
  for (int state = 0; state < stat + 1; state++) {
    int tmp = state;
    for (int z = 0; z < n; z++) {
      ss[z][state] = tmp % p;
      if (ss[z][state] == 0) mas[state] |= (1 << z);
      tmp /= p;
    }
  }
  for (int mask = 0; mask < (1 << n); mask++)
    for (int smask = 0; smask < (1 << n); smask++) {
      int pp = 0;
      for (int j = 0; j < n; j++) {
        d[j] = 0;
        if ((mask >> j & 1) != (smask >> j & 1)) {
          if (mask >> j & 1) d[j]--, tofm[mask][smask] |= (1 << j);
        }
      }
      int sstate = 0;
      for (int j = n - 1; j >= 0; j--) sstate *= p, sstate += d[j];
      tof[mask][smask] = sstate;
    }
  for (int i = 1; i < m + 1; i++) {
    int ind = b[i - 1];
    for (int state = 0; state < stat + 1; state++) {
      for (auto mask : v[ind]) {
        for (auto smask : v[(i == 1 ? 0 : b[i - 2])]) {
          if (tofm[mask][smask] & mas[state]) continue;
          int sstate = state + tof[mask][smask];
          if (dp[i - 1][smask][sstate] != -1 ||
              (i == 1 && sstate == 0 && smask == 0)) {
            dp[i][mask][state] = smask;
            break;
          }
        }
      }
    }
  }
  int answer = -1;
  for (int i = 0; i < (1 << n); i++) {
    if (dp[m][i][stat] > -1) {
      answer = i;
      break;
    }
  }
  solve(m, answer, stat);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cout << ans[i][j];
    cout << endl;
  }
  return 0;
}
