#include <bits/stdc++.h>
#pragma comment(linker, ”/ STACK : 256000000“)
using namespace std;
inline void fr(int &to) {
  char t = getchar();
  to ^= to;
  while (t > 47) {
    to = (to << 3) + (to << 1) + t - 48;
    t = getchar();
  }
}
void fw(int what) {
  if (what > 9) fw(what / 10);
  putchar(what % 10 + 48);
}
int n, m, a[30], b[30];
int ans_f = 2e9, aans[30], bans[30];
char ans_table[30][30];
long double T = 1000;
mt19937 rnd(time(0));
inline void input() {
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= m; ++i) cin >> b[i];
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) ans_table[i][j] = '.';
}
inline void output() {
  for (int i = 1; i <= n; ++i, cout << '\n')
    for (int j = 1; j <= m; ++j) cout << ans_table[i][j];
}
inline int Temp(int delta) {
  long double gen = rnd() / 4294967295.0l;
  int ret = gen <= exp(-(delta / T));
  T *= 0.995;
  return ret;
}
inline void solve() {
  int now_f = 0, anow[30] = {}, bnow[30] = {};
  char now_table[30][30];
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) now_table[i][j] = ans_table[i][j];
  int index1 = rnd() % n + 1;
  int index2 = rnd() % m + 1;
  if (now_table[index1][index2] == '.')
    now_table[index1][index2] = '*';
  else
    now_table[index1][index2] = '.';
  for (int i = 1; i <= n; ++i)
    for (int j = 1, cnt = 0; j <= m + 1; ++j)
      if (now_table[i][j] == '*')
        cnt++;
      else if (cnt)
        anow[i]++, cnt = 0;
  for (int j = 1; j <= m; ++j)
    for (int i = 1, cnt = 0; i <= n + 1; ++i)
      if (now_table[i][j] == '*')
        cnt++;
      else if (cnt)
        bnow[j]++, cnt = 0;
  for (int i = 1; i <= n; ++i) now_f += pow(a[i] - anow[i], 2);
  for (int i = 1; i <= m; ++i) now_f += pow(b[i] - bnow[i], 2);
  if (now_f < ans_f) {
    ans_f = now_f;
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= m; ++j) ans_table[i][j] = now_table[i][j];
    for (int i = 1; i <= n; ++i) aans[i] = anow[i];
    for (int i = 1; i <= m; ++i) bans[i] = bnow[i];
  } else if (Temp(now_f - ans_f)) {
    ans_f = now_f;
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= m; ++j) ans_table[i][j] = now_table[i][j];
    for (int i = 1; i <= n; ++i) aans[i] = anow[i];
    for (int i = 1; i <= m; ++i) bans[i] = bnow[i];
  }
}
int main() {
  input();
  while (ans_f) solve();
  output();
}
