#include <bits/stdc++.h>
using namespace std;
int n, m, rn[5], cn[20];
vector<char> col[5];
vector<char> cur;
bool tryit[11][11][11][11][11][20][40];
void solve(const vector<char>& cur) {
  for (int j = 0; j < n; ++j) {
    for (int i = 0; i < m; ++i)
      if (cur[i] & (1 << j))
        printf("*");
      else
        printf(".");
    puts("");
  }
  exit(0);
}
void work(int k, char p, int r0, int r1, int r2, int r3, int r4) {
  if (k == m) {
    if (r0 || r1 || r2 || r3 || r4) return;
    solve(cur);
    return;
  }
  if (r0 < 0 || r1 < 0 || r2 < 0 || r3 < 0 || r4 < 0) return;
  if (tryit[r0][r1][r2][r3][r4][k][p]) return;
  tryit[r0][r1][r2][r3][r4][k][p] = true;
  for (char c : col[cn[k]]) {
    cur.push_back(c);
    work(k + 1, c, (r0) - ((((p ^ c) >> 0) & 1) && ((c >> 0) & 1)),
         (r1) - ((((p ^ c) >> 1) & 1) && ((c >> 1) & 1)),
         (r2) - ((((p ^ c) >> 2) & 1) && ((c >> 2) & 1)),
         (r3) - ((((p ^ c) >> 3) & 1) && ((c >> 3) & 1)),
         (r4) - ((((p ^ c) >> 4) & 1) && ((c >> 4) & 1)));
    cur.pop_back();
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) scanf("%d", rn + i);
  for (int i = 0; i < m; ++i) scanf("%d", cn + i);
  for (char c = 0; c < (1 << n); ++c) {
    int cnt = 0;
    for (int j = 0; j < n; ++j)
      if (c & (1 << j) && (!j || !(c & (1 << (j - 1))))) cnt++;
    col[cnt].push_back(c);
  }
  work(0, 0, rn[0], rn[1], rn[2], rn[3], rn[4]);
}
