#include <bits/stdc++.h>
using namespace std;
const int N = 20 + 7;
const long long base = 591;
int n, m, a[N], b[N], o[N][N];
unordered_set<long long> s[N];
void calc(int x, int y) {
  if (y == m + 1) {
    if (a[x] != 0) return;
    for (int i = 1; i <= m; i++)
      if (b[i] > (n + 1 - x) / 2) return;
    long long hsh = 0, tmp = 0;
    for (int i = 1; i <= m; i++)
      tmp = tmp * 2 + o[x][i], hsh = hsh * base + b[i];
    hsh = hsh * base + tmp;
    if (s[x].count(hsh)) return;
    s[x].insert(hsh);
    calc(x + 1, 1);
  }
  if (x == n + 1) {
    for (int i = 1; i <= n; i++)
      if (a[i]) return;
    for (int i = 1; i <= m; i++)
      if (b[i]) return;
    swap(n, m);
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) cout << (o[j][i] ? '*' : '.');
      cout << endl;
    }
    exit(0);
  }
  if ((m + 1 - y + 1) / 2 < a[x]) return;
  calc(x, y + 1);
  if (!o[x][y - 1]) a[x]--;
  if (!o[x - 1][y]) b[y]--;
  if (!(b[y] == -1 || a[x] == -1)) {
    o[x][y] = 1;
    calc(x, y + 1);
    o[x][y] = 0;
  }
  if (!o[x][y - 1]) a[x]++;
  if (!o[x - 1][y]) b[y]++;
}
int32_t main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int j = 1; j <= m; j++) cin >> b[j];
  swap(n, m);
  swap(a, b);
  calc(1, 1);
}
