#include <bits/stdc++.h>
using namespace std;
const int MOD = 1 << 12;
const int SIZE = 1e6 + 10;
int row[10], col[40];
map<int, pair<int, int> > dp[22][1 << 12];
int seg_n[32];
void pre() {
  int d[5];
  for (int i = 0; i < (32); ++i) {
    memset((d), 0, sizeof((d)));
    for (int j = 0; j < (5); ++j) d[j] = (i >> j) & 1;
    for (int j = 0; j < (5); ++j) {
      if (d[j]) {
        if (j == 0 || d[j - 1] == 0) seg_n[i]++;
      }
    }
  }
}
char res[5][40];
char ch(int x) {
  if (x) return '*';
  return '.';
}
void print(int m, int v) {
  map<int, pair<int, int> >::iterator it = dp[m][v & (MOD - 1)].find(v);
  for (int k = 0; k < (5); ++k)
    res[k][m - 1] = ch((((it->second).second) >> k) & 1);
  if (m > 1) print(m - 1, (it->second).first);
}
bool get_answer(int x, int v, int n, int m) {
  if (x == n) {
    if (dp[m][v & (MOD - 1)].count(v)) {
      print(m, v);
      return 1;
    }
    return 0;
  }
  if (get_answer(x + 1, v | ((row[x] * 2) << (5 * x)), n, m)) return 1;
  if (row[x] && get_answer(x + 1, v | ((row[x] * 2 - 1) << (5 * x)), n, m))
    return 1;
  return 0;
}
int main() {
  pre();
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < (n); ++i) scanf("%d", &(row[i]));
  for (int i = 0; i < (m); ++i) scanf("%d", &(col[i]));
  dp[0][0][0] = make_pair(-1, -1);
  int nn = 1 << n;
  for (int i = 0; i < (m); ++i) {
    for (int mod = 0; mod < (MOD); ++mod) {
      for (map<int, pair<int, int> >::iterator it = dp[i][mod].begin();
           it != dp[i][mod].end(); it++) {
        int me[5];
        int now = it->first;
        for (int j = 0; j < (n); ++j) {
          me[j] = now & 31;
          now >>= 5;
        }
        for (int j = 0; j < (nn); ++j) {
          if (seg_n[j] != col[i]) continue;
          int you[5];
          memcpy(you, me, sizeof(int) * n);
          for (int k = 0; k < (n); ++k) {
            if ((you[k] & 1) != ((j >> k) & 1)) you[k]++;
          }
          int nxt = 0;
          bool err = 0;
          for (int k = 0; k < (n); ++k) {
            if (you[k] > row[k] * 2 || you[k] + (m - i) < row[k] * 2) err = 1;
            nxt |= you[k] << (5 * k);
          }
          if (err) continue;
          dp[i + 1][nxt & (MOD - 1)][nxt] = make_pair(it->first, j);
        }
      }
    }
  }
  if (!get_answer(0, 0, n, m)) puts("err!!!");
  for (int i = 0; i < (n); ++i) puts(res[i]);
  return 0;
}
