#include <bits/stdc++.h>
using namespace std;
bool dp[6][(1 << 5)];
bool vis[20][(1 << 5)][162000];
int a[20], b[20];
void Read(int n, int m) {
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int j = 0; j < m; j++) cin >> b[j];
}
int cal(int i) {
  int ret = 0;
  int pre = 0;
  while (i) {
    if (i % 2 == 1) {
      if (pre == 0) {
        ret++;
      }
      pre = 1;
    } else
      pre = 0;
    i /= 2;
  }
  return ret;
}
void init(int n) {
  memset(dp, 0, sizeof(dp));
  int s[10] = {0};
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < (1 << (n)); i++) {
    dp[cal(i)][i] = true;
    s[cal(i)]++;
  }
}
int ans[20];
int num[5];
int cnt = 0;
bool DFS(int n, int m, int col) {
  if (col == m) {
    bool flag = true;
    for (int i = 0; i < n; i++) {
      if (a[i] != num[i]) flag = false;
    }
    return flag;
  }
  bool flag = true;
  int temp;
  for (int i = 0; i < (1 << (n)); i++) {
    if (dp[b[col]][i]) {
      flag = true;
      temp = 0;
      ans[col] = i;
      for (int k = 0; k < n; k++) {
        if (i & (1 << k)) {
          if (col == 0 || (ans[col - 1] & (1 << k)) == 0) {
            num[k]++;
            if (num[k] > a[k]) flag = false;
          }
        }
        temp = temp * 10 + num[k];
      }
      if (flag && !vis[col][i][temp] && DFS(n, m, col + 1)) {
        return true;
      }
      if (flag) vis[col][i][temp] = true;
      for (int k = 0; k < n; k++) {
        if (i & (1 << k)) {
          if (col == 0 || (ans[col - 1] & (1 << k)) == 0) {
            num[k]--;
          }
        }
      }
    }
  }
  return false;
}
void answer(int n, int m) {
  memset(num, 0, sizeof(num));
  if (!DFS(n, m, 0)) cout << "NO" << endl;
}
void output(int n, int m) {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if ((1 << i) & ans[j]) {
        cout << "*";
      } else {
        cout << ".";
      }
    }
    cout << endl;
  }
}
int main() {
  std::iostream::sync_with_stdio(false);
  int n, m;
  while (cin >> n >> m) {
    Read(n, m);
    init(n);
    answer(n, m);
    output(n, m);
  }
  return 0;
}
