#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
template <class T>
inline T lowbit(T x) {
  return x & (-x);
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
inline bool scan(T &ret) {
  char c;
  int sgn;
  if (c = getchar(), c == EOF) return 0;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  ret *= sgn;
  return 1;
}
const double pi = 3.14159265358979323846264338327950288L;
using namespace std;
int n, m;
int a[23], b[23];
short dp[21][1 << 5][11 * 11 * 11 * 11 * 11 + 5];
int Pow[6];
int ans[6][21];
bool ok(int i, int j) {
  int ans = 0;
  while (j) {
    if (j & 1) {
      ans++;
      while (j & 1) {
        j >>= 1;
      }
    }
    j >>= 1;
  }
  return ans == b[i];
}
bool ok(int num) {
  for (int i = 0; i < n; i++) {
    if (a[i] != num % 11) return 0;
    num /= 11;
  }
  return 1;
}
bool dfs(int i, int pre, int st) {
  if (dp[i][pre][st] != -1) return dp[i][pre][st];
  if (i == m - 1) {
    if (ok(st)) {
      dp[i][pre][st] = 1;
    } else
      dp[i][pre][st] = 0;
    return dp[i][pre][st];
  }
  i++;
  for (int now = 0; now < (1 << n); now++) {
    int tmp = st;
    for (int j = 0; j < n; j++) {
      if (!((pre & (1 << j)) > 0) && ((now & (1 << j)) > 0)) tmp += Pow[j];
    }
    if (ok(i, now) && dfs(i, now, tmp)) {
      for (int j = 0; j < 5; j++) ans[j][i] = ((now & (1 << j)) > 0);
      return dp[i - 1][pre][st] = 1;
    }
  }
  return dp[i - 1][pre][st] = 0;
}
int main() {
  Pow[0] = 1;
  for (int i = 1; i <= 5; i++) Pow[i] = Pow[i - 1] * 11;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  memset(dp, -1, sizeof(dp));
  for (int i = 0; i < (1 << n); i++) {
    int tmp = 0;
    for (int j = 0; j < n; j++) {
      tmp += Pow[j] * ((i & (1 << j)) > 0);
    }
    if (ok(0, i) && dfs(0, i, tmp)) {
      for (int j = 0; j < 5; j++) ans[j][0] = ((i & (1 << j)) > 0);
      break;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      printf("%c", (ans[i][j] ? '*' : '.'));
    }
    printf("\n");
  }
  return 0;
}
