#include <bits/stdc++.h>
using namespace std;
long long n, m, hm;
long long ans[20], an[5], am[20];
vector<long long> pre[4];
long long prep[5] = {1, 6, 36, 216, 1296};
unordered_map<long long, vector<long long>> tb;
bool vis[25][(1 << 5)][7780];
inline long long g6(long long mask, long long ind) {
  return (mask / prep[ind]) % 6;
}
void answer() {
  for (long long(i) = (0); (i) < (n); ++(i)) {
    for (long long(j) = (0); (j) < (m); ++(j)) {
      cout << ((ans[j] & (1 << i)) ? '*' : '.');
    }
    cout << endl;
  }
  exit(0);
}
vector<long long> store;
void f2(long long ind, long long lmask, long long mask) {
  if (ind < hm) {
    long long key = mask + (lmask << 30);
    tb[key] = store;
    return;
  }
  if (vis[ind][lmask][mask]) return;
  for (long long next : pre[am[ind]]) {
    long long nmask = mask;
    for (long long(i) = (0); (i) < (n); ++(i)) {
      if ((next & (1 << i)) && !(lmask & (1 << i))) nmask += 1 * prep[i];
    }
    store.push_back(next);
    f2(ind - 1, next, nmask);
    store.pop_back();
  }
  vis[ind][lmask][mask] = 1;
}
void f1(long long ind, long long lmask, long long mask) {
  if (ind == hm) {
    for (long long(i) = (0); (i) < (n); ++(i))
      if (g6(mask, i) > an[i]) return;
    for (long long(i) = (0); (i) < (n); ++(i)) an[i] -= g6(mask, i);
    bool valid = 1;
    for (long long(i) = (0); (i) < (n); ++(i)) {
      if (an[i] > ((m - hm + 1) >> 1)) valid = 0;
    }
    if (valid)
      for (long long(lm) = (0); (lm) < (1 << n); ++(lm)) {
        long long key = lm << 30;
        for (long long(i) = (0); (i) < (n); ++(i)) {
          if ((lm & (1 << i)) && (lmask & (1 << i))) ++an[i];
          key += an[i] * prep[i];
        }
        if (tb.find(key) != tb.end()) {
          vector<long long> vans = tb[key];
          for (long long(i) = (0); (i) < (vans.size()); ++(i)) {
            ans[m - i - 1] = vans[i];
          }
          answer();
        }
        for (long long(i) = (0); (i) < (n); ++(i))
          if ((lm & (1 << i)) && (lmask & (1 << i))) --an[i];
      }
    for (long long(i) = (0); (i) < (n); ++(i)) an[i] += g6(mask, i);
    return;
  }
  if (vis[ind][lmask][mask]) return;
  for (long long next : pre[am[ind]]) {
    long long nmask = mask;
    for (long long(i) = (0); (i) < (n); ++(i)) {
      if (next & (1 << i) && !(lmask & (1 << i))) nmask += 1 * prep[i];
    }
    ans[ind] = next;
    f1(ind + 1, next, nmask);
  }
  vis[ind][lmask][mask] = 1;
}
int main() {
  cin >> n >> m;
  hm = (m >> 1);
  for (long long(i) = (0); (i) < (n); ++(i)) cin >> an[i];
  for (long long(i) = (0); (i) < (m); ++(i)) cin >> am[i];
  for (long long mask = 0; mask < (1 << n); ++mask) {
    long long c = 0, last = 0;
    for (long long i = 0; i < n; ++i) {
      if (mask & (1 << i) && last == 0) {
        ++c;
      }
      last = mask & (1 << i);
    }
    pre[c].push_back(mask);
  }
  for (long long(i) = (0); (i) < (m); ++(i)) {
    for (long long(j) = (0); (j) < (32); ++(j)) {
      for (long long(k) = (0); (k) < (7780); ++(k)) vis[i][j][k] = 0;
    }
  }
  f2(m - 1, 0, 0);
  f1(0, 0, 0);
}
