#include <bits/stdc++.h>
using namespace std;
const int N = 5, M = 20, MAX = 2e5;
int a[N], b[M], n, m, aa[N];
bool mark[M][MAX][1 << N], ch[N][M];
vector<int> h[N];
void dfs(int v, int msk2, int msk) {
  if (v == m) {
    for (int i = 0; i < n; i++)
      if (a[i] != aa[i]) return;
    for (int i = 0; i < n; i++, cout << '\n')
      for (int j = 0; j < m; j++) cout << (ch[i][j] ? '*' : '.');
    exit(0);
  }
  if (mark[v][msk2][msk]) return;
  mark[v][msk2][msk] = 1;
  for (auto mask : h[b[v]]) {
    bool flag = true;
    for (int i = 0; i < n; i++)
      if (mask & (1 << i)) {
        ch[i][v] = true;
        if (!v || !ch[i][v - 1]) {
          aa[i]++;
          if (aa[i] > a[i]) flag = false;
        }
      } else
        ch[i][v] = false;
    int s = 0;
    for (int i = 0; i < n; i++) s = s * M / 2 + aa[i];
    if (flag) dfs(v + 1, s, mask);
    for (int i = 0; i < n; i++)
      if ((mask & (1 << i)) && (!v || !ch[i][v - 1])) aa[i]--;
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  for (int mask = 0; mask < (1 << n); mask++) {
    int tmp = 0, cnt = 0;
    for (int i = 0; i < n; i++)
      if (mask & (1 << i)) {
        if (!tmp) tmp = 1, cnt++;
      } else
        tmp = 0;
    h[cnt].push_back(mask);
  }
  dfs(0, 0, 0);
}
