#include <bits/stdc++.h>
using namespace std;
int H, W;
int A[30], B[30];
string S[50];
set<int> cand[5];
int p12[6], tar;
map<pair<int, int>, pair<int, int> > from[21];
int ok(int curv, int c) {
  int i;
  for (i = 0; i < H; i++) {
    int seg = curv / p12[i] % 12;
    if (seg > A[i]) return 0;
    if (seg + (W - c) / 2 + 2 < A[i]) return 0;
  }
  return 1;
}
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  p12[0] = 1;
  for (i = 0; i < 5; i++) p12[i + 1] = p12[i] * 12;
  cin >> H >> W;
  for (i = 0; i < H; i++) cin >> A[i], tar += p12[i] * A[i];
  for (i = 0; i < W; i++) cin >> B[i];
  for (i = 0; i < 1 << H; i++) {
    x = 0;
    for (y = 0; y < 10; y++)
      if ((i & (1 << y)) && ((i & (1 << (y + 1))) == 0)) x++;
    cand[x].insert(i);
  }
  from[0][make_pair(0, 0)] = make_pair(0, 0);
  for (i = 0; i < W; i++) {
    for (auto& r : from[i]) {
      for (auto& c : cand[B[i]]) {
        x = r.first.first;
        for (y = 0; y < H; y++)
          if ((c & (1 << y)) && ((r.first.second & (1 << y)) == 0)) x += p12[y];
        if (ok(x, i)) from[i + 1][make_pair(x, c)] = r.first;
      }
    }
  }
  pair<int, int> goal;
  for (auto& r : from[W])
    if (r.first.first == tar) goal = r.first;
  for (x = W - 1; x >= 0; x--) {
    for (y = 0; y < H; y++) S[y] += ".*"[(goal.second & (1 << y)) > 0];
    goal = from[x + 1][goal];
  }
  for (y = 0; y < H; y++) {
    reverse(S[y].begin(), S[y].end());
    cout << S[y] << endl;
  }
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false);
  for (i = 0; i < argc - 1; i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < s.size(); i++) ungetc(s[s.size() - 1 - i], stdin);
  solve();
  return 0;
}
