#include <bits/stdc++.h>
using namespace std;
const int BMASK = 33, EMASK = 122222;
bool dp[21][BMASK][EMASK];
bool vs[21][BMASK][EMASK];
int n, m, a[6], b[21], mp[6][21];
vector<int> seg[6];
void read() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int j = 1; j <= m; j++) cin >> b[j];
  b[0] = 0;
}
bool dfs(int col, int bMask, int eMask) {
  if (col == 0) {
    if (bMask == 0 && eMask == 0) return true;
    return false;
  }
  if (vs[col][bMask][eMask]) return dp[col][bMask][eMask];
  vs[col][bMask][eMask] = true;
  dp[col][bMask][eMask] = false;
  int tmp = eMask, c[6], d[6];
  for (int i = 0; i < n; i++) {
    c[i] = tmp % 11;
    tmp /= 11;
    if ((col + 1) / 2 < c[i]) return false;
  }
  for (int i = 0; i < n; i++) {
    if (bMask & (1 << i))
      mp[i][col - 1] = 1;
    else
      mp[i][col - 1] = 0;
  }
  for (int i = 0; i < (int)seg[b[col - 1]].size(); i++) {
    int bm = seg[b[col - 1]][i], em = 0;
    bool can = true;
    for (int j = 0; j < n; j++) d[j] = c[j];
    for (int j = n - 1; j >= 0; j--) {
      int t1 = bm & (1 << j), t2 = bMask & (1 << j);
      if (t2 > 0 && t1 == 0) d[j]--;
      if (d[j] < 0) {
        can = false;
        break;
      }
      em = em * 11 + d[j];
    }
    if (!can) continue;
    bool flag = dfs(col - 1, bm, em);
    if (flag) {
      dp[col][bMask][eMask] = true;
      return true;
    }
  }
  return false;
}
void print() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (mp[i][j] == 1)
        printf("*");
      else
        printf(".");
    }
    printf("\n");
  }
}
void solve() {
  for (int i = 0; i < n; i++) seg[i].clear();
  for (int mask = 0; mask < (1 << n); mask++) {
    int j = 0, k = 0;
    for (int i = 0; i < n; i++) {
      if (mask & (1 << i)) {
        if (k == 0) {
          j++;
          k = 1;
        }
      } else {
        k = 0;
      }
    }
    seg[j].push_back(mask);
  }
  memset(vs, false, sizeof(vs));
  memset(dp, false, sizeof(dp));
  int dMask = 0;
  for (int i = n - 1; i >= 0; i--) {
    dMask = dMask * 11 + a[i];
  }
  for (int i = 0; i < (int)seg[b[m]].size(); i++) {
    int mask = seg[b[m]][i];
    bool can = true;
    for (int j = 0; j < n; j++)
      if (mask & (1 << j)) {
        if (a[j] == 0) {
          can = false;
          break;
        }
      }
    if (!can) continue;
    if (dfs(m, mask, dMask)) {
      print();
      return;
    }
  }
}
int main() {
  read();
  solve();
  return 0;
}
