#include <bits/stdc++.h>
#pragma comment(linker, "/stack:16777216")
using namespace std;
const int INF = 1000000000;
const int MAX = 64;
const int MAX2 = 170000;
const int BASE = 1000000000;
const int CNT = MAX2 / 32 + 1;
double eps = 1E-7;
int n, m;
int R[MAX];
int C[MAX];
unsigned int A[21][1 << 5][MAX2 / 32];
int D[1 << 5][1 << 5];
int W[1 << 5];
int P[MAX];
int B[MAX][MAX];
int get(int a, int b, int c) {
  return (A[a][b][c / 32] & (1 << (c % 32))) != 0;
}
int main() {
  P[0] = 1;
  for (int i = (1); i < (MAX); ++i) P[i] = P[i - 1] * 11;
  cin >> n >> m;
  for (int i = (0); i < (n); ++i) cin >> R[i];
  for (int i = (0); i < (m); ++i) cin >> C[i];
  for (int i = (0); i < ((1 << n)); ++i) {
    W[i] = 0;
    for (int j = (0); j < (n); ++j) {
      if ((i & (1 << j)) != 0)
        if (j == 0 || ((i & (1 << (j - 1))) == 0)) ++W[i];
    }
  }
  for (int i = (0); i < ((1 << n)); ++i) {
    for (int j = (0); j < ((1 << n)); ++j) {
      D[i][j] = 0;
      for (int k = (0); k < (n); ++k) {
        if ((i & (1 << k)) == 0)
          if ((j & (1 << k)) != 0) D[i][j] += P[k];
      }
    }
  }
  A[0][0][0] = 1;
  for (int i = (0); i < (m); ++i)
    for (int j = (0); j < ((1 << n)); ++j) {
      for (int k = (0); k < ((1 << n)); ++k) {
        if (W[k] != C[i]) continue;
        int add = D[j][k];
        int pos = add;
        int id = pos / 32;
        for (int l = 0; l < CNT; ++l) {
          if (id + 1 >= CNT) break;
          if (A[i][j][l] != 0) {
            if (pos % 32 == 0) {
              A[i + 1][k][id] |= A[i][j][l];
            } else {
              int a = (pos % 32);
              int b = (32 - a);
              A[i + 1][k][id] |= (A[i][j][l] << a);
              A[i + 1][k][id + 1] |= (A[i][j][l] >> b);
            }
          }
          ++id;
          pos += 32;
        }
      }
    }
  int w = 0;
  for (int i = (0); i < (n); ++i) w += P[i] * R[i];
  int mask = -1;
  for (int i = (0); i < ((1 << n)); ++i)
    if (get(m, i, w) == 1) {
      mask = i;
    }
  int x = m;
  while (x > 0) {
    for (int i = (0); i < (n); ++i)
      if ((mask & (1 << i)) != 0) B[i][x - 1] = 1;
    for (int mask2 = (0); mask2 < ((1 << n)); ++mask2) {
      int w2 = (w - D[mask2][mask]);
      if (w2 >= 0) {
        if (get(x - 1, mask2, w2)) {
          mask = mask2;
          w = w2;
          --x;
          break;
        }
      }
    }
  }
  for (int i = (0); i < (n); ++i) {
    for (int j = (0); j < (m); ++j)
      if (B[i][j])
        cout << '*';
      else
        cout << '.';
    cout << endl;
  }
  return 0;
}
