#include <bits/stdc++.h>
using namespace std;
vector<int> v[12];
int n, m;
int A[101];
int B[100];
vector<int> ans;
int mat[50][50][6];
bool dp[21][33][11][11][11][11][11];
bool vis[21][33][11][11][11][11][11];
char grid[50][50];
void pre() {
  for (int i = 0; i <= (1 << n); i++) {
    for (int j = 0; j <= (1 << n); j++) {
      int a = i;
      int b = j;
      for (int k = 0; k < n; k++) {
        if ((a & (1 << k)) == 0 && (b & (1 << k)))
          mat[i][j][k] = 1;
        else
          mat[i][j][k] = 0;
      }
    }
  }
}
bool solve(int pos, int bit, int a, int b, int c, int d, int e) {
  if (a > A[0] || b > A[1] || c > A[2] || d > A[3] || e > A[4]) return false;
  if (pos == m) {
    if (a == A[0] && b == A[1] && c == A[2] && d == A[3] && e == A[4]) {
      return true;
    }
    return false;
  }
  if (vis[pos][bit][a][b][c][d][e]) return dp[pos][bit][a][b][c][d][e];
  vis[pos][bit][a][b][c][d][e] = 1;
  bool &ret = dp[pos][bit][a][b][c][d][e];
  ret = 0;
  int id = B[pos], x, y;
  for (int i = 0; i < v[id].size(); i++) {
    x = bit;
    y = v[id][i];
    ret = ret | solve(pos + 1, y, a + mat[x][y][0], b + mat[x][y][1],
                      c + mat[x][y][2], d + mat[x][y][3], e + mat[x][y][4]);
    if (ret) return ret;
  }
  return ret;
}
void path(int pos, int bit, int a, int b, int c, int d, int e) {
  if (pos == m) {
    return;
  }
  int ret = 0;
  ret = 0;
  int id = B[pos], x, y;
  for (int i = 0; i < v[id].size(); i++) {
    x = bit;
    y = v[id][i];
    ret = ret | solve(pos + 1, y, a + mat[x][y][0], b + mat[x][y][1],
                      c + mat[x][y][2], d + mat[x][y][3], e + mat[x][y][4]);
    if (ret) {
      ans.push_back(y);
      path(pos + 1, y, a + mat[x][y][0], b + mat[x][y][1], c + mat[x][y][2],
           d + mat[x][y][3], e + mat[x][y][4]);
      return;
    };
  }
}
int main() {
  cin >> n >> m;
  for (int i = (0); i <= (n - 1); i++) cin >> A[i];
  for (int i = (0); i <= (m - 1); i++) cin >> B[i];
  for (int i = (0); i <= ((1 << n) - 1); i++) {
    int bit = i;
    int tmp[10];
    for (int j = (0); j <= (n - 1); j++) {
      if (i & (1 << j))
        tmp[j] = 1;
      else
        tmp[j] = 0;
    }
    int cnt = 0;
    for (int j = (0); j <= (n - 1); j++) {
      if (j == 0 && tmp[j] == 1)
        cnt++;
      else if (tmp[j] == tmp[j - 1])
        continue;
      else if (tmp[j] == 1 && tmp[j - 1] == 0)
        cnt++;
    }
    v[cnt].push_back(i);
  }
  pre();
  int ret = 0;
  ret = solve(0, 0, 0, 0, 0, 0, 0);
  path(0, 0, 0, 0, 0, 0, 0);
  for (int j = 0; j < m; j++) {
    int bit = ans[j];
    for (int i = 0; i < n; i++) {
      if (bit & (1 << i))
        grid[i][j] = '*';
      else
        grid[i][j] = '.';
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cout << grid[i][j];
    }
    cout << endl;
  }
}
