#include <bits/stdc++.h>
using namespace std;
const int N = 22;
int a[N], b[N], n, m, now[N], cnt[N];
bool adj[11][1 << 19][20][2];
char c[N][N];
vector<int> who[N];
struct hash_pair {
  inline size_t operator()(const pair<int, int> &v) const {
    return (v.first << 31) + v.second;
  }
};
unordered_set<pair<int, int>, hash_pair> s[N];
int Pow(int a, int b) { return b ? (b & 1 ? a : 1) * Pow(a * a, b >> 1) : 1; }
void bt(int col) {
  if (col == m) {
    for (int i = 0; i < n; i++)
      if (cnt[i] != a[i]) return;
    for (int i = 0; i < n; i++, printf("\n"))
      for (int j = 0; j < m; j++) printf("%c", c[i][j]);
    exit(0);
  }
  int state = 0;
  for (int i = 0; i < n; i++) state += Pow(11, i) * cnt[i];
  int mask = 0;
  for (int i = 0; i < n; i++) mask += (1 << i) * (c[i][col - 1] == '*');
  if (s[col].count({state, mask})) return;
  s[col].insert({state, mask});
  for (auto msk : who[b[col]]) {
    for (int i = 0; i < n; i++)
      if (msk >> i & 1) {
        c[i][col] = '*';
        if (col == 0 || c[i][col - 1] == '.') cnt[i]++;
      }
    bool go_on = true;
    for (int i = 0; i < n; i++) go_on &= adj[a[i]][now[i]][col][msk >> i & 1];
    if (col - 2 >= 0)
      for (int i = 1; i + 1 < n; i++)
        if (c[i][col - 1] == '.' && (c[i][col - 2] != c[i][col]) &&
            (c[i - 1][col - 1] != c[i + 1][col - 1]))
          go_on = false;
    for (int i = 0; i < n; i++) now[i] ^= (1 << col) * (msk >> i & 1);
    if (go_on || col == m - 1) bt(col + 1);
    for (int i = 0; i < n; i++) {
      if (c[i][col] == '*' && (col == 0 || c[i][col - 1] == '.')) cnt[i]--;
      c[i][col] = '.';
    }
    for (int i = 0; i < n; i++) now[i] ^= (1 << col) * (msk >> i & 1);
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) c[i][j] = '.';
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < m; i++) scanf("%d", &b[i]);
  for (int msk = 0; msk < 1 << n; msk++) {
    vector<bool> v;
    for (int i = 0; i < n; i++) v.push_back(msk >> i & 1);
    v.push_back(0);
    int res = 0;
    for (int i = 1; i < n + 1; i++) res += (v[i] == 0 && v[i - 1] == 1);
    who[res].push_back(msk);
  }
  for (int msk = 0; msk < 1 << m; msk++) {
    vector<bool> v;
    for (int i = 0; i < m; i++) v.push_back(msk >> i & 1);
    v.push_back(0);
    int res = 0;
    for (int i = 1; i < m + 1; i++) res += (v[i] == 0 && v[i - 1] == 1);
    int now = 0;
    for (int i = 0; i < m; i++) {
      if (now < 1 << 19) adj[res][now][i][v[i]] = true;
      now ^= (1 << i) & (msk);
    }
  }
  bt(0);
  return 0;
}
