#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void amin(T &a, const T &b) {
  if (a > b) a = b;
}
template <class T>
inline void amax(T &a, const T &b) {
  if (a < b) a = b;
}
int N, M, A[9], B[21];
char F[9][33];
vector<int> G[6];
int bs(int S) {
  bool prev = false;
  int cnt = 0;
  for (int i = 0, i_len = (N); i < i_len; ++i) {
    if (!prev && S & (1 << i)) cnt++;
    prev = (bool)(S & (1 << i));
  }
  return cnt;
}
int mem[161051][21];
bool rec(int col, const int S) {
  if (col == M) {
    for (int i = 0, i_len = (N); i < i_len; ++i)
      if (A[i]) return false;
    return true;
  }
  for (int i = 0, i_len = (N); i < i_len; ++i)
    if (A[i] < 0 || 2 * A[i] - 1 > M - col) return false;
  int st = 0;
  for (int i = 0, i_len = (N); i < i_len; ++i) st = st * 11 + A[i];
  if (mem[st][col] & (1u << S)) return false;
  mem[st][col] |= (1u << S);
  vector<int> v = G[B[col]];
  random_shuffle(v.begin(), v.end());
  for (__typeof((v).begin()) e = (v).begin(), e_end = (v).end(); e != e_end;
       ++e) {
    for (int i = 0, i_len = (N); i < i_len; ++i)
      if (~S & (1 << i) && *e & (1 << i)) A[i]--;
    if (rec(col + 1, *e)) {
      for (int i = 0, i_len = (N); i < i_len; ++i)
        F[i][col] = (*e & (1 << i) ? '*' : '.');
      return true;
    }
    for (int i = 0, i_len = (N); i < i_len; ++i)
      if (~S & (1 << i) && *e & (1 << i)) A[i]++;
  }
  return false;
}
void test() {
  N = 5;
  M = 20;
  for (int i = 0, i_len = (N); i < i_len; ++i)
    for (int j = 0, j_len = (M); j < j_len; ++j) F[i][j] = ".*"[rand() % 2];
  for (int i = 0, i_len = (N); i < i_len; ++i) {
    A[i] = 0;
    char p = '.';
    for (int j = 0, j_len = (M); j < j_len; ++j) {
      if (p == '.' && F[i][j] == '*') A[i]++;
      p = F[i][j];
    }
  }
  for (int j = 0, j_len = (M); j < j_len; ++j) {
    B[j] = 0;
    char p = '.';
    for (int i = 0, i_len = (N); i < i_len; ++i) {
      if (p == '.' && F[i][j] == '*') B[j]++;
      p = F[i][j];
    }
  }
  for (int i = 0, i_len = (N); i < i_len; ++i) fprintf(stderr, "%s\n", F[i]);
  fprintf(stderr, "--\n");
  memset(F, 0, sizeof F);
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 0, i_len = (N); i < i_len; ++i) scanf("%d", A + i);
  for (int i = 0, i_len = (M); i < i_len; ++i) scanf("%d", B + i);
  for (int S = 0, S_len = (1 << N); S < S_len; ++S) G[bs(S)].push_back(S);
  rec(0, 0);
  for (int i = 0, i_len = (N); i < i_len; ++i) puts(F[i]);
  return 0;
}
