#include <bits/stdc++.h>
using namespace std;
const int Mod = 12;
int a[100], b[100];
int n, m;
int cc[100];
vector<int> dd[100];
void init() {
  for (int i = 0; i < (1 << n); i++) {
    for (int j = 0; j < n; j++) {
      if ((i >> j) & 1) {
        if (0 == j || (((i ^ (i << 1)) >> j) & 1)) cc[i]++;
      }
    }
    dd[cc[i]].push_back(i);
  }
}
struct Re {
  int a, b, c;
  Re() {}
  Re(int a, int b, int c) : a(a), b(b), c(c) {}
};
bitset<12 * 12 * 12 * 12 * 12> vis[22][1 << 5], dp[22][1 << 5];
map<int, Re> pp[22][1 << 5];
int fs;
int dfs(int row, int pre, int st) {
  if (vis[row][pre][st]) {
    if (dp[row][pre][st]) return 1;
    return 0;
  }
  vis[row][pre][st] = 1;
  if (row == m) {
    if (st == fs) return dp[row][pre][st] = 1;
    return dp[row][pre][st] = 0;
  }
  int x[6], y[6];
  for (int i = n - 1, j = st; i >= 0; i--) {
    x[i] = j % Mod;
    j /= Mod;
  }
  for (int k = 0; k < dd[b[row]].size(); k++) {
    int i = dd[b[row]][k];
    for (int j = 0; j < n; j++) y[j] = x[j];
    for (int j = 0; j < n; j++) {
      if ((i >> j) & 1) {
        if ((pre >> j) & 1) continue;
        y[j]++;
      }
    }
    int nowst = 0;
    bool judge = true;
    for (int j = 0; j < n; j++) {
      if (y[j] > a[j]) {
        judge = false;
        break;
      }
      nowst *= Mod;
      nowst += y[j];
    }
    if (!judge) {
      continue;
    }
    if (dfs(row + 1, i, nowst)) {
      pp[row + 1][i][nowst] = Re(row, pre, st);
      return dp[row][pre][st] = 1;
    }
  }
  return dp[row][pre][st] = 0;
}
char mat[10][30];
void out(int row, int msk, int st) {
  Re now = Re(row, msk, st);
  while (now.a) {
    for (int i = 0; i < n; i++) {
      if ((now.b >> i) & 1) {
        mat[i][now.a - 1] = '*';
      } else {
        mat[i][now.a - 1] = '.';
      }
    }
    now = pp[now.a][now.b][now.c];
  }
  for (int i = 0; i < n; i++) {
    puts(mat[i]);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  init();
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    fs = fs * Mod + a[i];
  }
  for (int i = 0; i < m; i++) {
    scanf("%d", &b[i]);
  }
  dfs(0, 0, 0);
  for (int i = 0; i < (1 << n); i++) {
    if (dp[m][i][fs]) {
      out(m, i, fs);
      break;
    }
  }
  return 0;
}
