#include <bits/stdc++.h>
using namespace std;
const double PI = 3.141592653589793;
const int N = 20 + 5;
bool sign;
int n, m;
int r[N];
int w[N];
int f[N];
int ans[N];
int g[N];
int q[N];
bool v[21][32][170000];
int countg(int k) {
  int cnt = 0;
  bool pre, now;
  pre = false;
  for (int i = 0; i < n; i++) {
    now = (f[i] & k) > 0 ? true : false;
    if (!pre && now) cnt++;
    pre = now;
  }
  return cnt;
}
bool check(int k, int state) {
  int cnt, now;
  for (cnt = 1; cnt <= n; cnt++) {
    now = state % 11;
    if (now > r[cnt] || now + (m - k + 1) / 2 < r[cnt]) return false;
    state = state / 11;
  }
  return true;
}
void dfs(int k, int pre, int state) {
  if (k == m + 1) {
    sign = true;
    return;
  }
  if (sign) return;
  v[k - 1][pre][state] = true;
  int now;
  for (int i = 0; i < f[n]; i++)
    if (g[i] == w[k]) {
      now = state;
      for (int j = 0; j < n; j++) {
        if ((i & f[j]) > 0 && (pre & f[j]) == 0) {
          now += q[j];
        }
      }
      if (check(k, now) && (k == m + 1 || !v[k][i][now])) {
        ans[k] = i;
        dfs(k + 1, i, now);
      }
      if (sign) return;
    }
}
void init() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &r[i]);
  for (int i = 1; i <= m; i++) scanf("%d", &w[i]);
  f[0] = q[0] = 1;
  for (int i = 1; i <= n; i++) f[i] = f[i - 1] << 1, q[i] = q[i - 1] * 11;
  for (int i = 0; i < f[n]; i++) g[i] = countg(i);
}
void work() {
  dfs(1, 0, 0);
  if (sign) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++)
        if (f[i - 1] & ans[j])
          putchar('*');
        else
          putchar('.');
      putchar('\n');
    }
  }
}
int main() {
  init();
  work();
  return 0;
}
