#include <bits/stdc++.h>
using namespace std;
const int maxA =
    1 + 10 + 11 * 10 + 11 * 11 * 10 + 11 * 11 * 11 * 10 + 121 * 121 * 10;
int a[6], lim[22], ans[22];
vector<int> MASKS[5];
int n, m;
bool mem[22][33][maxA];
void print();
inline int modify(int a, int mask, int sub, int sign = -1) {
  int b = 0;
  int temp = 1;
  for (int i = 1; i <= n; i++) {
    int y = (((mask >> i - 1) & 1)) * sign * (1 - ((sub >> i - 1) & 1));
    int dg = (a % 11) + y;
    a /= 11;
    if (dg < 0) return -1;
    b = (b + dg * temp);
    temp *= 11;
  }
  return b;
}
inline bool check(int a, int remain) {
  remain = (remain + 1) / 2;
  for (int i = 1; i <= n; i++) {
    int x = a % 11;
    a /= 11;
    if (x > remain) return 0;
  }
  return 1;
}
void f(int step, int a, int sub) {
  if (mem[step][sub][a] || !check(a, m - step + 1)) {
    return;
  }
  mem[step][sub][a] = 1;
  if (step == m + 1) {
    if (a == 0) print();
    return;
  }
  int sz = MASKS[lim[step]].size();
  for (int i = 0; i < sz; i++) {
    int mask = MASKS[lim[step]][i];
    int b = modify(a, mask, sub);
    if (b != -1) {
      ans[step] = mask;
      f(step + 1, b, mask);
    }
  }
}
void print() {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cout << ((((ans[j] >> i - 1) & 1) == 1) ? '*' : '.');
    }
    cout << endl;
  }
  exit(0);
}
int main() {
  ios_base::sync_with_stdio(0);
  srand(31415);
  cin >> n >> m;
  for (int mask = 0; mask < (1 << n); mask++) {
    int x = 0;
    for (int i = 0; i < n; i++) {
      if (((mask >> i) & 1) && (i == 0 || !((mask >> i - 1) & 1))) x++;
    }
    MASKS[x].push_back(mask);
  }
  for (int i = 0; i <= 3; i++) random_shuffle(MASKS[i].begin(), MASKS[i].end());
  for (int i = 1; i <= n; i++) cin >> a[i];
  int temp = 1, A = 0;
  for (int i = 1; i <= n; i++) {
    A += temp * a[i];
    temp *= 11;
  }
  assert(A < maxA);
  for (int i = 1; i <= m; i++) cin >> lim[i];
  f(1, A, 0);
  return 0;
}
