#include <bits/stdc++.h>
using namespace std;
const int maxn = 5 + 1;
const int maxm = 20 + 1;
const int maxk = 161051 + 1;
int n, m, a[maxn], b[maxm], T;
bool dp[maxm][32][maxk];
char ans[maxn][maxm];
int Pow[maxn];
int dfs(int col, int scol, int srow) {
  if (dp[col][scol][srow] == 1) return 0;
  dp[col][scol][srow] = 1;
  if (col == m) return (srow == T);
  for (int sta = 0, u = (1 << n); sta < u; sta++) {
    int s = srow, t = 0;
    for (int j = 0; j < n; j++) {
      if (((1 << j) & sta)) {
        if (!((1 << j) & scol)) s += Pow[j];
        if (!((1 << (j + 1)) & sta)) t++;
      }
    }
    if (t == b[col] && dfs(col + 1, sta, s)) {
      for (int j = 0; j < 5; j++) ans[j][col] = (((1 << j) & sta) ? '*' : '.');
      return 1;
    }
  }
  return 0;
}
int main() {
  scanf("%d%d", &n, &m);
  Pow[0] = 1;
  T = 0;
  for (int i = 1; i < 5; i++) Pow[i] = Pow[i - 1] * 11;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    T += (Pow[i] * a[i]);
  }
  for (int i = 0; i < m; i++) scanf("%d", &b[i]);
  dfs(0, 0, 0);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) printf("%c", ans[i][j]);
    printf("\n");
  }
  return 0;
}
