#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> ans;
int row[5], col[20];
vector<int> v[3];
bool vis[20][11][11][11][11][11][1 << 5];
bool solve(int x, int r1, int r2, int r3, int r4, int r5, int mask) {
  if (x == m) {
    if (r1 + r2 + r3 + r4 + r5) return false;
    return true;
  }
  bool &ret = vis[x][r1][r2][r3][r4][r5][mask];
  if (ret) return false;
  ret = true;
  int a[5];
  a[0] = r1, a[1] = r2, a[2] = r3, a[3] = r4, a[4] = r5;
  int h = col[x];
  for (int i = 0; i < v[h].size(); i++) {
    int b[5] = {0};
    int now = v[h][i];
    for (int j = 0; j < n; j++) b[j] = a[j];
    bool flag = true;
    for (int j = 0; j < n; j++) {
      if ((mask & (1 << j)) == 0 && now & (1 << j)) b[j]--;
      if (b[j] < 0) {
        flag = false;
        break;
      }
    }
    if (flag) {
      if (solve(x + 1, b[0], b[1], b[2], b[3], b[4], now)) {
        ans.push_back(now);
        return true;
      }
    }
  }
  return false;
}
int main() {
  scanf("%d", &n);
  ;
  scanf("%d", &m);
  ;
  for (int i = 0; i < n; i++) scanf("%d", &row[i]);
  ;
  for (int i = 0; i < m; i++) scanf("%d", &col[i]);
  ;
  for (int i = 0; i < 1 << n; i++) {
    int c = 0, pre = 0;
    for (int j = 0; j < n; j++) {
      if (i & (1 << j) && !pre) {
        pre = 1;
        c++;
      } else
        pre = bool(i & (1 << j));
    }
    v[c].push_back(i);
  }
  solve(0, row[0], row[1], row[2], row[3], row[4], 0);
  reverse(ans.begin(), ans.end());
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < ans.size(); j++) {
      if (ans[j] & (1 << i))
        cout << '*';
      else
        cout << '.';
    }
    cout << "\n";
  }
  return 0;
}
