#include <bits/stdc++.h>
using namespace std;
const int N = 5;
const int M = 20;
int a[N], b[M];
set<vector<int> > state[M + 1];
char ans[N][M];
int n, m;
void dp(int y, vector<int>& cur) {
  if (y == m) {
    for (int i = 0; i < n; i++) {
      if (a[i] != cur[i]) {
        return;
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        cout << ans[i][j];
      }
      cout << endl;
    }
    exit(0);
  }
  if (state[y].find(cur) != state[y].end()) {
    return;
  }
  for (int mask = 0; mask < (1 << n); ++mask) {
    for (int x = 0; x < n; ++x) {
      ans[x][y] = (mask & (1 << x)) ? '*' : '.';
    }
    int cnt = 0;
    for (int x = 0; x < n; x++) {
      if (ans[x][y] == '*' && (x == 0 || ans[x - 1][y] == '.')) {
        cnt++;
      }
    }
    if (cnt != b[y]) continue;
    vector<int> nc = cur;
    bool flag = true;
    for (int x = 0; x < n; x++) {
      if (ans[x][y] == '*' && (y == 0 || ans[x][y - 1] == '.')) {
        nc[x]++;
      }
      if (nc[x] > a[x] || (m - y) / 2 + nc[x] < a[x]) {
        flag = false;
        break;
      }
    }
    nc.back() = mask;
    if (flag) {
      dp(y + 1, nc);
    }
  }
  state[y].insert(cur);
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  vector<int> tmp = vector<int>(n + 1, 0);
  dp(0, tmp);
  return 0;
}
