#include <bits/stdc++.h>
using namespace std;
int n, m;
int rn[5], cn[20];
vector<char> col[5];
vector<char> cur;
bool tryit[20][40][11][11][11][11][11];
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 prev, int r0, int r1, int r2, int r3, int r4) {
  if (r0 < 0 || r1 < 0 || r2 < 0 || r3 < 0 || r4 < 0) return;
  if (k == m) {
    if (r0 || r1 || r2 || r3 || r4) return;
    solve(cur);
    return;
  }
  if (tryit[k][prev][r0][r1][r2][r3][r4]) return;
  tryit[k][prev][r0][r1][r2][r3][r4] = true;
  for (int i = 0; i < (int)col[cn[k]].size(); ++i) {
    char c = col[cn[k]][i];
    cur.push_back(c);
    work(k + 1, c, r0 - ((((prev ^ c) >> 0) & 1) && ((c >> 0) & 1)),
         r1 - ((((prev ^ c) >> 1) & 1) && ((c >> 1) & 1)),
         r2 - ((((prev ^ c) >> 2) & 1) && ((c >> 2) & 1)),
         r3 - ((((prev ^ c) >> 3) & 1) && ((c >> 3) & 1)),
         r4 - ((((prev ^ 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);
  }
  vector<char> a;
  vector<int> b(5, 0);
  work(0, 0, rn[0], rn[1], rn[2], rn[3], rn[4]);
}
