#include <bits/stdc++.h>
using namespace std;
set<long long int> dp;
char board[10][25];
int f(int cur, int last, vector<int> &row, vector<int> &col, vector<int> &v,
      vector<vector<int> > &mask) {
  int n = row.size();
  int m = col.size();
  long long int st = (cur << 5) | last;
  for (int(i) = (0); (i) < (v.size()); (i)++) {
    st = (st << 5) | v[i];
  }
  if (dp.count(st)) return 0;
  dp.insert(st);
  for (int(i) = (0); (i) < (n); (i)++) {
    if (v[i] > row[i]) {
      return 0;
    }
    int diff = m - cur;
    if (v[i] + diff < row[i]) {
      return 0;
    }
  }
  if (cur == m) {
    for (int(i) = (0); (i) < (n); (i)++)
      if (v[i] != row[i]) return 0;
    for (int(i) = (0); (i) < (n); (i)++) {
      for (int(j) = (0); (j) < (m); (j)++) cout << board[i][j];
      cout << '\n';
    }
    return 1;
  }
  for (int(i) = (0); (i) < (mask[col[cur]].size()); (i)++) {
    int r = mask[col[cur]][i];
    for (int(k) = (0); (k) < (n); (k)++) {
      if ((r >> k) & 1) {
        board[k][cur] = '*';
        if (cur == 0) {
          v[k] = 1;
        } else {
          if (board[k][cur - 1] == '.') {
            v[k]++;
          }
        }
      } else {
        board[k][cur] = '.';
        if (cur == 0) {
          v[k] = 0;
        }
      }
    }
    int ret = f(cur + 1, r, row, col, v, mask);
    if (ret) return ret;
    for (int(k) = (0); (k) < (n); (k)++) {
      if ((r >> k) & 1) {
        if (cur and board[k][cur - 1] == '.') {
          v[k]--;
        }
      }
    }
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int n, m;
  cin >> n >> m;
  vector<int> row(n), col(m);
  for (int(i) = (0); (i) < (n); (i)++) cin >> row[i];
  for (int(i) = (0); (i) < (m); (i)++) cin >> col[i];
  vector<vector<int> > mask(n + 1);
  for (int(m) = (0); (m) < (1 << n); (m)++) {
    int cnt = 0;
    for (int(k) = (1); (k) < (n + 1); (k)++) {
      int a = (m >> k) & 1;
      int b = (m >> (k - 1)) & 1;
      if (!a and b) {
        cnt++;
      }
    }
    mask[cnt].push_back(m);
  }
  vector<int> v(n);
  f(0, 0, row, col, v, mask);
  return 0;
}
