#include <bits/stdc++.h>
using namespace std;
const int MAXN = 25, MAXH = 2e5, P = 11;
vector<int> S[MAXN];
int Max, N, M, Ans[MAXN], A[MAXN], B[MAXN];
bool Get, Flag[MAXN][MAXH][MAXN * 2];
int GetNum(int Num) {
  bool Flag = 0;
  int Ans = 0;
  for (int i = 0; i < N; i++) {
    if ((Num >> i) & 1) {
      if (!Flag) ++Ans;
      Flag = 1;
    } else
      Flag = 0;
  }
  return Ans;
}
void Prepare() {
  Max = 1 << N;
  for (int i = 0; i < Max; i++) S[GetNum(i)].push_back(i);
}
bool Check(int Hash) {
  for (int i = 1; i <= N; i++, Hash /= P)
    if (Hash % P != A[i]) return 0;
  return 1;
}
bool Impossible(int Now, int Hash) {
  for (int i = 1; i <= N; i++, Hash /= P) {
    int Num = Hash % P;
    if (Num > A[i]) return 1;
    if (Num + (M - Now + 2) / 2 < A[i]) return 1;
  }
  return 0;
}
int NewHash(int Hash, int Pre, int Now) {
  int New = 0;
  static int D[MAXN];
  for (int i = 0; i < N; i++, Hash /= P)
    D[i] = Hash % P + (((Pre >> i) & 1) == 0 && ((Now >> i) & 1) == 1);
  for (int i = N - 1; i + 1; i--) New = New * P + D[i];
  return New;
}
void Printf() {
  for (int i = 0; i < N; i++) {
    for (int j = 1; j <= M; j++) printf("%c", ((Ans[j] >> i) & 1) ? '*' : '.');
    printf("\n");
  }
}
void Solve(int Now, int Hash, int Pre) {
  if (Flag[Now][Hash][Pre]) return;
  Flag[Now][Hash][Pre] = 1;
  if (Now > M) {
    if (Check(Hash)) {
      Get = 1;
      Printf();
    }
    return;
  }
  if (Impossible(Now, Hash)) return;
  for (int i = 0; i < S[B[Now]].size(); i++) {
    Ans[Now] = S[B[Now]][i];
    Solve(Now + 1, NewHash(Hash, Pre, Ans[Now]), Ans[Now]);
    if (Get) return;
  }
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= N; i++) scanf("%d", &A[i]);
  for (int i = 1; i <= M; i++) scanf("%d", &B[i]);
  Prepare();
  Get = 0;
  Solve(1, 0, 0);
}
