#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7fffffff;
const int N = 50 + 5;
inline int read() {
  int x = 0, rev = 0, ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') rev = 1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return rev ? -x : x;
}
int n, m, a[N], b[N];
vector<int> f[N];
char ans[N][N];
void dfs(int op, int use, int sum, int pos) {
  if (pos == n) {
    f[sum].push_back(op);
    return;
  }
  dfs(op, 0, sum, pos + 1), dfs(op | (1 << pos), 1, sum + (use == 0), pos + 1);
}
set<int> g[N][N];
bool dp(int pos, int pre) {
  if (pos == m) {
    for (int i = 0; i < n; i++)
      if (a[i] != 0) return 0;
    for (int i = 0; i < n; i++) ans[i][pos] = '\0';
    return 1;
  }
  int tmp = 1, p = 0;
  for (int i = 0; i < 5; i++) p += a[i] * tmp, tmp *= 11;
  if (g[pos][pre].count(p)) return 0;
  for (auto d : f[b[pos]]) {
    for (int j = 0; j < n; j++) {
      if ((d & (1 << j)) && (pre & (1 << j)) == 0) a[j]--;
    }
    int flg = 0;
    for (int j = 0; j < n; j++) {
      if (a[j] < 0 || ((m - 1 - pos) / 2 + 1 < a[j])) {
        flg = 1;
        break;
      }
    }
    if (!flg && dp(pos + 1, d)) {
      for (int j = 0; j < n; j++) ans[j][pos] = (d & (1 << j)) ? '*' : '.';
      return 1;
    }
    for (int j = 0; j < n; j++) {
      if ((d & (1 << j)) && (pre & (1 << j)) == 0) a[j]++;
    }
  }
  g[pos][pre].insert(p);
  return 0;
}
int main() {
  n = read(), m = read();
  dfs(0, 0, 0, 0);
  for (int i = 0; i < n; i++) a[i] = read();
  for (int i = n + 1; i < 5; i++) a[i] = 0;
  for (int i = 0; i < m; i++) b[i] = read();
  for (int i = 0; i < m; i++)
    for (int j = 0; j < 33; j++) g[i][j].clear();
  dp(0, 0);
  for (int i = 0; i < n; i++) cout << ans[i] << endl;
  return 0;
}
