#include <bits/stdc++.h>
#include <numeric>
#define M 1000000007
#define inf 1e18+1
#define pb push_back
// #define mp make_pair
#define forz(i,s,n) for(lli i=s;i<n;i++)
#define fore(i,n,s) for(lli i=n;i>=s;i--)
#define shaktimaan ios_base ::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

#define fast_io                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);

typedef long long int lli;
//typedef pair<long long int, long long int> pll;
typedef unsigned long long int ull;
using namespace std;

lli recpow(lli x, lli n, lli mod)
{
    if (n == 0)
        return 1;
    else if (n % 2 == 0) //n is even
        return recpow((x * x) % mod, n / 2, mod);
    else //n is odd
        return (x * recpow((x * x) % mod, (n - 1) / 2, mod)) % mod;
}

bool sortbysec(const pair<pair<lli, lli>, lli> &a,
               const pair<pair<lli, lli>, lli> &b)
{
    if(a.second==b.second)
    return (a.first.second<b.first.second);
    else
    return (a.second > b.second);
}

lli modInverse(lli n, lli p)
{
    return recpow(n, p - 2, p);
}

lli nCr(lli n, lli r, lli p)
{
    // Base case
    if (r == 0)
        return 1;

    // Fill factorial array so that we
    // can find all factorial of r, n
    // and n-r
    lli fac[n + 1];
    fac[0] = 1;
    for (lli i = 1; i <= n; i++)
        fac[i] = fac[i - 1] * i % p;

    return (fac[n] * modInverse(fac[r], p) % p *
            modInverse(fac[n - r], p) % p) %
           p;
}

const int N = 15000001;
int sp[N+1];
vector<int> pr;
void sieve()
{
    forz(i,2,N+1)
    {
        if (sp[i] == 0)
        {
            sp[i] = i;
            pr.pb(i);
        }
        for (int j=0; j<(int)pr.size() && pr[j]<=sp[i] && i*pr[j]<=N; ++j)
            sp[i*pr[j]] = pr[j];
    }
}
vector<lli> pf(lli n)
{
    lli no=n;
    vector<lli> v;
    while(no!=1)
    {
        lli h=sp[no];
        v.pb(h);
        no/=h;
    }
    return v;
}

string rev(string s)
{
    string t;
    fore(i,s.length()-1,0)
    {
        t.pb(s[i]);
    }
    return t;
}

bool is_p(lli n)
{
    for(lli i=2;i*i<=n;++i)
    {
        if(n%i==0)
        return false;
    }
    return true;
}

bool ispow2(lli n)
{
    while(n%2==0)
    n/=2;
    if(n==1)
    return true;
    return false;
}

bool comp(pair<lli, lli> a, pair<lli, lli> b)
{
    if(a.first==b.first)
    return a.second<b.second;
    else
    return a.first<b.first;
}

string itos(lli n)
{
    string s="";
    if(n==0)
    return "0";
    while(n>0)
    {
        s.pb(n%10+'0');
        n/=10;
    }
    s=rev(s);
    return s;
}

lli chckpow(lli n)
{
    lli c=0;
    while(n>1)
    {
        n=(n+3)/4;
        c++;
    }
    return c;
}
lli a,b,c,d,s=0,n;
char mat[100][100];

pair<lli, lli> nex(lli x, lli y)
{
    pair<lli, lli> p;
    if(((s==0 and x%2==0) || (s==1 and x%2==1)) and y==0)
    {
        if(mat[x][y+1]=='.')
        p={x+1,y};
        else
        p={x,y+1};
    }
    else if(((s==1 and x%2==0) || (s==0 and x%2==1)) and y==a+c-1)
    {
        if(mat[x][y-1]=='.')
        p={x+1,y};
        else
        p={x,y-1};
    }
    else if(y==0 || y==a+c-1)
    p={x+1,y};
    else if(s==0)
    {
        if(x%2==0)
        {
            if(mat[x][y+1]=='.')
            p={x+1,y};
            else
            p={x,y+1};
        }
        else
        {
            if(mat[x][y-1]=='.')
            p={x+1,y};
            else
            p={x,y-1};
        }
    }
    else
    {
        if(x%2==1)
        {
            if(mat[x][y+1]=='.')
            p={x+1,y};
            else
            p={x,y+1};
        }
        else
        {
            if(mat[x][y-1]=='.')
            p={x+1,y};
            else
            p={x,y-1};
        }
    }
    return p;
}

//code begins here
int main()
{
    shaktimaan
    // sieve();
    cin>>a>>b>>c>>d>>n;
    lli ld[n];
    forz(i,0,n)
    cin>>ld[i];
    forz(i,0,max(b,d))
    forz(j,0,a+c)
    mat[i][j]='+';
    if(b>d)
    {
        if(d%2==1)
        s=1;
        forz(j,a,a+c)
        forz(i,d,b)
        mat[i][j]='.';
    }
    else if(b<d)
    {
        if(b%2==0)
        s=1;
        forz(j,0,a)
        forz(i,b,d)
        mat[i][j]='.';
    }
    // forz(i,0,max(b,d))
    // forz(j,0,a+c)
    // cout<<mat[i][j]<<" \n"[j==a+c-1];
    lli x,y;
    if(s==0)
    x=0,y=0;
    else
    x=0,y=a+c-1;
    lli pt=0;
    while(pt<n)
    {
        mat[x][y]='a'+pt;
        ld[pt]--;
        if(ld[pt]==0)
        pt++;
        if(pt==n)
        break;
        pair<lli, lli> p=nex(x,y);
        x=p.first, y=p.second;
    }
    cout<<"YES\n";
    forz(i,0,max(b,d))
    {
        forz(j,0,a+c)
        cout<<mat[i][j];
        cout<<"\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#include <numeric>
#define M 1000000007
#define inf 1e18+1
#define pb push_back
// #define mp make_pair
#define forz(i,s,n) for(lli i=s;i<n;i++)
#define fore(i,n,s) for(lli i=n;i>=s;i--)
#define shaktimaan ios_base ::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

#define fast_io                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);

typedef long long int lli;
//typedef pair<long long int, long long int> pll;
typedef unsigned long long int ull;
using namespace std;

lli recpow(lli x, lli n, lli mod)
{
    if (n == 0)
        return 1;
    else if (n % 2 == 0) //n is even
        return recpow((x * x) % mod, n / 2, mod);
    else //n is odd
        return (x * recpow((x * x) % mod, (n - 1) / 2, mod)) % mod;
}

bool sortbysec(const pair<pair<lli, lli>, lli> &a,
               const pair<pair<lli, lli>, lli> &b)
{
    if(a.second==b.second)
    return (a.first.second<b.first.second);
    else
    return (a.second > b.second);
}

lli modInverse(lli n, lli p)
{
    return recpow(n, p - 2, p);
}

lli nCr(lli n, lli r, lli p)
{
    // Base case
    if (r == 0)
        return 1;

    // Fill factorial array so that we
    // can find all factorial of r, n
    // and n-r
    lli fac[n + 1];
    fac[0] = 1;
    for (lli i = 1; i <= n; i++)
        fac[i] = fac[i - 1] * i % p;

    return (fac[n] * modInverse(fac[r], p) % p *
            modInverse(fac[n - r], p) % p) %
           p;
}

const int N = 15000001;
int sp[N+1];
vector<int> pr;
void sieve()
{
    forz(i,2,N+1)
    {
        if (sp[i] == 0)
        {
            sp[i] = i;
            pr.pb(i);
        }
        for (int j=0; j<(int)pr.size() && pr[j]<=sp[i] && i*pr[j]<=N; ++j)
            sp[i*pr[j]] = pr[j];
    }
}
vector<lli> pf(lli n)
{
    lli no=n;
    vector<lli> v;
    while(no!=1)
    {
        lli h=sp[no];
        v.pb(h);
        no/=h;
    }
    return v;
}

string rev(string s)
{
    string t;
    fore(i,s.length()-1,0)
    {
        t.pb(s[i]);
    }
    return t;
}

bool is_p(lli n)
{
    for(lli i=2;i*i<=n;++i)
    {
        if(n%i==0)
        return false;
    }
    return true;
}

bool ispow2(lli n)
{
    while(n%2==0)
    n/=2;
    if(n==1)
    return true;
    return false;
}

bool comp(pair<lli, lli> a, pair<lli, lli> b)
{
    if(a.first==b.first)
    return a.second<b.second;
    else
    return a.first<b.first;
}

string itos(lli n)
{
    string s="";
    if(n==0)
    return "0";
    while(n>0)
    {
        s.pb(n%10+'0');
        n/=10;
    }
    s=rev(s);
    return s;
}

lli chckpow(lli n)
{
    lli c=0;
    while(n>1)
    {
        n=(n+3)/4;
        c++;
    }
    return c;
}
lli a,b,c,d,s=0,n;
char mat[100][100];

pair<lli, lli> nex(lli x, lli y)
{
    pair<lli, lli> p;
    if(((s==0 and x%2==0) || (s==1 and x%2==1)) and y==0)
    {
        if(mat[x][y+1]=='.')
        p={x+1,y};
        else
        p={x,y+1};
    }
    else if(((s==1 and x%2==0) || (s==0 and x%2==1)) and y==a+c-1)
    {
        if(mat[x][y-1]=='.')
        p={x+1,y};
        else
        p={x,y-1};
    }
    else if(y==0 || y==a+c-1)
    p={x+1,y};
    else if(s==0)
    {
        if(x%2==0)
        {
            if(mat[x][y+1]=='.')
            p={x+1,y};
            else
            p={x,y+1};
        }
        else
        {
            if(mat[x][y-1]=='.')
            p={x+1,y};
            else
            p={x,y-1};
        }
    }
    else
    {
        if(x%2==1)
        {
            if(mat[x][y+1]=='.')
            p={x+1,y};
            else
            p={x,y+1};
        }
        else
        {
            if(mat[x][y-1]=='.')
            p={x+1,y};
            else
            p={x,y-1};
        }
    }
    return p;
}

//code begins here
int main()
{
    shaktimaan
    // sieve();
    cin>>a>>b>>c>>d>>n;
    lli ld[n];
    forz(i,0,n)
    cin>>ld[i];
    forz(i,0,max(b,d))
    forz(j,0,a+c)
    mat[i][j]='+';
    if(b>d)
    {
        if((b-d)%2==1)
        s=1;
        forz(j,a,a+c)
        forz(i,d,b)
        mat[i][j]='.';
    }
    else if(b<d)
    {
        if((d-b)%2==0)
        s=1;
        forz(j,0,a)
        forz(i,b,d)
        mat[i][j]='.';
    }
    // forz(i,0,max(b,d))
    // forz(j,0,a+c)
    // cout<<mat[i][j]<<" \n"[j==a+c-1];
    lli x,y;
    if(s==0)
    x=0,y=0;
    else
    x=0,y=a+c-1;
    lli pt=0;
    while(pt<n)
    {
        mat[x][y]='a'+pt;
        ld[pt]--;
        if(ld[pt]==0)
        pt++;
        if(pt==n)
        break;
        pair<lli, lli> p=nex(x,y);
        x=p.first, y=p.second;
    }
    forz(i,0,max(b,d))
    forz(j,0,a+c)
    cout<<mat[i][j]<<" \n"[j==a+c-1];
    return 0;
}


#include <bits/stdc++.h>
#include <numeric>
#define M 1000000007
#define inf 1e18+1
#define pb push_back
// #define mp make_pair
#define forz(i,s,n) for(lli i=s;i<n;i++)
#define fore(i,n,s) for(lli i=n;i>=s;i--)
#define shaktimaan ios_base ::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

#define fast_io                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);

typedef long long int lli;
//typedef pair<long long int, long long int> pll;
typedef unsigned long long int ull;
using namespace std;

lli recpow(lli x, lli n, lli mod)
{
    if (n == 0)
        return 1;
    else if (n % 2 == 0) //n is even
        return recpow((x * x) % mod, n / 2, mod);
    else //n is odd
        return (x * recpow((x * x) % mod, (n - 1) / 2, mod)) % mod;
}

bool sortbysec(const pair<pair<lli, lli>, lli> &a,
               const pair<pair<lli, lli>, lli> &b)
{
    if(a.second==b.second)
    return (a.first.second<b.first.second);
    else
    return (a.second > b.second);
}

lli modInverse(lli n, lli p)
{
    return recpow(n, p - 2, p);
}

lli nCr(lli n, lli r, lli p)
{
    // Base case
    if (r == 0)
        return 1;

    // Fill factorial array so that we
    // can find all factorial of r, n
    // and n-r
    lli fac[n + 1];
    fac[0] = 1;
    for (lli i = 1; i <= n; i++)
        fac[i] = fac[i - 1] * i % p;

    return (fac[n] * modInverse(fac[r], p) % p *
            modInverse(fac[n - r], p) % p) %
           p;
}

const int N = 15000001;
int sp[N+1];
vector<int> pr;
void sieve()
{
    forz(i,2,N+1)
    {
        if (sp[i] == 0)
        {
            sp[i] = i;
            pr.pb(i);
        }
        for (int j=0; j<(int)pr.size() && pr[j]<=sp[i] && i*pr[j]<=N; ++j)
            sp[i*pr[j]] = pr[j];
    }
}
vector<lli> pf(lli n)
{
    lli no=n;
    vector<lli> v;
    while(no!=1)
    {
        lli h=sp[no];
        v.pb(h);
        no/=h;
    }
    return v;
}

string rev(string s)
{
    string t;
    fore(i,s.length()-1,0)
    {
        t.pb(s[i]);
    }
    return t;
}

bool is_p(lli n)
{
    for(lli i=2;i*i<=n;++i)
    {
        if(n%i==0)
        return false;
    }
    return true;
}

bool ispow2(lli n)
{
    while(n%2==0)
    n/=2;
    if(n==1)
    return true;
    return false;
}

bool comp(pair<lli, lli> a, pair<lli, lli> b)
{
    if(a.first==b.first)
    return a.second<b.second;
    else
    return a.first<b.first;
}

string itos(lli n)
{
    string s="";
    if(n==0)
    return "0";
    while(n>0)
    {
        s.pb(n%10+'0');
        n/=10;
    }
    s=rev(s);
    return s;
}

lli chckpow(lli n)
{
    lli c=0;
    while(n>1)
    {
        n=(n+3)/4;
        c++;
    }
    return c;
}
lli a,b,c,d,s=0,n;
char mat[100][100];

pair<lli, lli> nex(lli x, lli y)
{
    pair<lli, lli> p;
    if(((s==0 and x%2==0) || (s==1 and x%2==1)) and y==0)
    {
        if(mat[x][y+1]=='.')
        p={x+1,y};
        else
        p={x,y+1};
    }
    else if(((s==1 and x%2==0) || (s==0 and x%2==1)) and y==a+c-1)
    {
        if(mat[x][y-1]=='.')
        p={x+1,y};
        else
        p={x,y-1};
    }
    else if(y==0 || y==a+c-1)
    p={x+1,y};
    else if(s==0)
    {
        if(x%2==0)
        {
            if(mat[x][y+1]=='.')
            p={x+1,y};
            else
            p={x,y+1};
        }
        else
        {
            if(mat[x][y-1]=='.')
            p={x+1,y};
            else
            p={x,y-1};
        }
    }
    else
    {
        if(x%2==1)
        {
            if(mat[x][y+1]=='.')
            p={x+1,y};
            else
            p={x,y+1};
        }
        else
        {
            if(mat[x][y-1]=='.')
            p={x+1,y};
            else
            p={x,y-1};
        }
    }
    return p;
}

//code begins here
int main()
{
    shaktimaan
    // sieve();
    cin>>a>>b>>c>>d>>n;
    lli ld[n];
    forz(i,0,n)
    cin>>ld[i];
    forz(i,0,max(b,d))
    forz(j,0,a+c)
    mat[i][j]='+';
    if(b>d)
    {
        if((b-d)%2==1)
        s=1;
        forz(j,a,a+c)
        forz(i,d,b)
        mat[i][j]='.';
    }
    else if(b<d)
    {
        if((d-b)%2==0)
        s=1;
        forz(j,0,a)
        forz(i,b,d)
        mat[i][j]='.';
    }
    // forz(i,0,max(b,d))
    // forz(j,0,a+c)
    // cout<<mat[i][j]<<" \n"[j==a+c-1];
    lli x,y;
    if(s==0)
    x=0,y=0;
    else
    x=0,y=a+c-1;
    lli pt=0;
    while(pt<n)
    {
        mat[x][y]='a'+pt;
        ld[pt]--;
        if(ld[pt]==0)
        pt++;
        if(pt==n)
        break;
        pair<lli, lli> p=nex(x,y);
        x=p.first, y=p.second;
    }
    cout<<"YES\n";
    forz(i,0,max(b,d))
    {
        forz(j,0,a+c)
        cout<<mat[i][j];
        cout<<"\n";
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define pb push_back
#define mp make_pair
#define cotu cout
#define itn int
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
#define setp(x) fixed << setprecision(x)
#define ordered_set tree<pair<long double, int> , null_type,less<pair<long double, int> >, rb_tree_tag,tree_order_statistics_node_update>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

const int inf = int(1e9);
const ll INF = ll(1e16);
const int mod = inf + 7;
const double PI = acos(-1.0);
void mul(ll &x, ll y){
  x *= y;
  if(x >= mod) x %= mod;
}
ll bp(ll a, ll n){
  ll r = 1;
  while(n){
    if(n & 1) mul(r, a);
    mul(a, a);
    n >>= 1;
  }
  return r;
}
template<typename T_vector> // neal
void output_vector(const T_vector &v, bool add_one = false, int start = -1, int end = -1) {
    if (start < 0) start = 0;
    if (end < 0) end = int(v.size());

    for (int i = start; i < end; i++)
        cout << v[i] + (add_one ? 1 : 0) << (i < end - 1 ? ' ' : '\n');
}
// 5 prob
// 800 - 10 min
// 900 - 13 min
// 1000 - 17 min
// 1100 - 23 min
// 1200 - 28 minutes
// 1300 - 26 minutes
void solve(){
  int a, b, c, d, n;
  cin >> a >> b >> c >> d >> n;
  swap(a, b);
  swap(c, d);
  int sum = 0;
  char u[max(a, c)][b + d];
  for(int i = 0; i < max(a, c); ++i)
    for(int j = 0; j < b + d; ++j)
      u[i][j] = '.';
  for(int i = 0; i < a; ++i)
    for(int j = 0; j < b; ++j)
      u[i][j] = 'X';
  for(int i = 0; i < c; ++i)
    for(int j = 0; j < d; ++j)
      u[i][j + b] = 'X';
  // rep(i, max(a, c)){
  //   rep(j, b + d)
  //   cout << u[i][j]; cout << '\n';
  // }

  string t = "";
  rep(i, n){
    int x;
    cin >> x;
    sum += x;
    rep(j, x) t += char(i + 'a');
  }
  if(sz(t) > a * b + c * d){
    cout << "NO\n";
  }else{
      cout << "YES\n";
      int dir = a & 1;
      int nxt = 0;
      for(int j = 0; j < b + d; ++j){
          if(!dir){
            for(int i = 0; i < max(a, c); ++i){
              if(u[i][j] == 'X'){
                u[i][j] = t[nxt++];
              }
            }
          }
          else{
            for(int i = max(a, c) - 1; i >= 0; --i){
              if(u[i][j] == 'X'){
                u[i][j] = t[nxt++];
              }
            }
          }
          dir ^= 1;
      }
      rep(i, max(a, c))
          rep(j, b + d){
            cout << u[i][j];
            if(b + d - 1 == j) cout << '\n';
          }

  }
}

int main()
{
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
    Red;
    int T = 1;
    // cin >> T;
    for(int i = 1; i <= T; ++i){
      solve();
    }
    return 0;

}


#include <bits/stdc++.h>
using namespace std;

template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define pb push_back
#define mp make_pair
#define cotu cout
#define itn int
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
#define setp(x) fixed << setprecision(x)
#define ordered_set tree<pair<long double, int> , null_type,less<pair<long double, int> >, rb_tree_tag,tree_order_statistics_node_update>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

const int inf = int(1e9);
const ll INF = ll(1e16);
const int mod = inf + 7;
const double PI = acos(-1.0);
void mul(ll &x, ll y){
  x *= y;
  if(x >= mod) x %= mod;
}
ll bp(ll a, ll n){
  ll r = 1;
  while(n){
    if(n & 1) mul(r, a);
    mul(a, a);
    n >>= 1;
  }
  return r;
}
template<typename T_vector> // neal
void output_vector(const T_vector &v, bool add_one = false, int start = -1, int end = -1) {
    if (start < 0) start = 0;
    if (end < 0) end = int(v.size());

    for (int i = start; i < end; i++)
        cout << v[i] + (add_one ? 1 : 0) << (i < end - 1 ? ' ' : '\n');
}
// 5 prob
// 800 - 10 min
// 900 - 13 min
// 1000 - 17 min
// 1100 - 23 min
// 1200 - 28 minutes
// 1300 - 26 minutes
void solve(){
  int a, b, c, d, n;
  cin >> a >> b >> c >> d >> n;
  swap(a, b);
  swap(c, d);
  int sum = 0;
  char u[max(a, c)][b + d];
  for(int i = 0; i < max(a, c); ++i)
    for(int j = 0; j < b + d; ++j)
      u[i][j] = '.';
  for(int i = 0; i < a; ++i)
    for(int j = 0; j < b; ++j)
      u[i][j] = 'X';
  for(int i = 0; i < c; ++i)
    for(int j = 0; j < d; ++j)
      u[i][j + b] = 'X';
  // rep(i, max(a, c)){
  //   rep(j, b + d)
  //   cout << u[i][j]; cout << '\n';
  // }

  string t = "";
  rep(i, n){
    int x;
    cin >> x;
    sum += x;
    rep(j, x) t += char(i + 'a');
  }
  if(sz(t) > a * b + c * d){
    cout << "NO\n";
  }else{
      cout << "YES\n";
      int dir = b & 1;
      int nxt = 0;
      for(int j = 0; j < b + d; ++j){
          if(!dir){
            for(int i = 0; i < max(a, c); ++i){
              if(u[i][j] == 'X'){
                u[i][j] = t[nxt++];
              }
            }
          }
          else{
            for(int i = max(a, c) - 1; i >= 0; --i){
              if(u[i][j] == 'X'){
                u[i][j] = t[nxt++];
              }
            }
          }
          dir ^= 1;
      }
      rep(i, max(a, c))
          rep(j, b + d){
            cout << u[i][j];
            if(b + d - 1 == j) cout << '\n';
          }

  }
}

int main()
{
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
    Red;
    int T = 1;
    // cin >> T;
    for(int i = 1; i <= T; ++i){
      solve();
    }
    return 0;

}


#include <bits/stdc++.h>
using namespace std;

template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define pb push_back
#define mp make_pair
#define cotu cout
#define itn int
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
#define setp(x) fixed << setprecision(x)
#define ordered_set tree<pair<long double, int> , null_type,less<pair<long double, int> >, rb_tree_tag,tree_order_statistics_node_update>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

const int inf = int(1e9);
const ll INF = ll(1e16);
const int mod = inf + 7;
const double PI = acos(-1.0);
void mul(ll &x, ll y){
  x *= y;
  if(x >= mod) x %= mod;
}
ll bp(ll a, ll n){
  ll r = 1;
  while(n){
    if(n & 1) mul(r, a);
    mul(a, a);
    n >>= 1;
  }
  return r;
}
template<typename T_vector> // neal
void output_vector(const T_vector &v, bool add_one = false, int start = -1, int end = -1) {
    if (start < 0) start = 0;
    if (end < 0) end = int(v.size());

    for (int i = start; i < end; i++)
        cout << v[i] + (add_one ? 1 : 0) << (i < end - 1 ? ' ' : '\n');
}
// 5 prob
// 800 - 10 min
// 900 - 13 min
// 1000 - 17 min
// 1100 - 23 min
// 1200 - 28 minutes
// 1300 - 26 minutes
void solve(){
  int a, b, c, d, n;
  cin >> a >> b >> c >> d >> n;
  int sum = 0;
  char u[max(a, c)][b + d];
  for(int i = 0; i < max(a, c); ++i)
    for(int j = 0; j < b + d; ++j)
      u[i][j] = '.';
  for(int i = 0; i < a; ++i)
    for(int j = 0; j < b; ++j)
      u[i][j] = 'X';
  for(int i = 0; i < c; ++i)
    for(int j = 0; j < d; ++j)
      u[i][j + b] = 'X';

  string t = "";
  rep(i, n){
    int x;
    cin >> x;
    sum += x;
    rep(j, x) t += char(i + 'a');
  }
  if(sz(t) > a * b + c * d){
    cout << "NO\n";
  }else{
      cout << "YES\n";
      int dir = b & 1;
      int nxt = 0;
      for(int j = 0; j < b + d; ++j){
          if(!dir){
            for(int i = 0; i < max(a, c); ++i){
              if(u[i][j] == 'X'){
                u[i][j] = t[nxt++];
              }
            }
          }
          else{
            for(int i = max(a, c) - 1; i >= 0; --i){
              if(u[i][j] == 'X'){
                u[i][j] = t[nxt++];
              }
            }
          }
          dir ^= 1;
      }
      rep(i, max(a, c))
          rep(j, b + d){
            cout << u[i][j];
            if(b + d - 1 == j) cout << '\n';
          }

  }
}

int main()
{
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
    Red;
    int T = 1;
    // cin >> T;
    for(int i = 1; i <= T; ++i){
      solve();
    }
    return 0;

}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ll a,b,c,d,n;
    cin>>a>>b>>c>>d>>n;
    vector<string> v;
    vector<char>v2;
    for(ll i = 0; i < max(b,d); i++){
        v.push_back(string(a+c,'.'));
    }
    char c2 = 'a';
    for(ll i = 0; i < n; i++,c2++){
        ll x2;cin>>x2;
        for(ll j = 0; j < x2; j++){
            v2.push_back(c2);
        }
    }
    ll turn =0;
    if(d%2 == 0) turn++;
    while(d--){
        if(v2.empty()) break;
        if(turn){
            for(ll i = a; i < a+c; i++){
                v[d][i] = v2.back();
                v2.pop_back();
            }
        }else{
            for(ll i = a+c-1; i >= a; i--){
                v[d][i] = v2.back();
                v2.pop_back();
            }
        }
        turn++;
        turn%=2;
    }
    turn++;
    turn%=2;
    for(ll i = 0; i < b; i++,turn++,turn%=2){
        if(v2.empty()) break;
        if(turn){
            for(ll j = 0; j < a; j++){
                v[i][j] = v2.back();
                v2.pop_back();
            }
        }else{
            for(ll j = a-1; j >= 0; j--){
                v[i][j] = v2.back();
                v2.pop_back();
            }
        }

    }
    for(ll i = 0; i < v.size(); i++){
        cout<<v[i]<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ll a,b,c,d,n;
    cin>>a>>b>>c>>d>>n;
    if(a*b+c*d < n){
        cout<<"NO\n";
        return 0;
    }
    vector<string> v;
    vector<char>v2;
    for(ll i = 0; i < max(b,d); i++){
        v.push_back(string(a+c,'.'));
    }
    char c2 = 'a';
    for(ll i = 0; i < n; i++,c2++){
        ll x2;cin>>x2;
        for(ll j = 0; j < x2; j++){
            v2.push_back(c2);
        }
    }
    ll turn =0;
    if(d%2 == 0) turn++;
    while(d--){
        if(v2.empty()) break;
        if(turn){
            for(ll i = a; i < a+c; i++){
                v[d][i] = v2.back();
                v2.pop_back();
            }
        }else{
            for(ll i = a+c-1; i >= a; i--){
                v[d][i] = v2.back();
                v2.pop_back();
            }
        }
        turn++;
        turn%=2;
    }
    turn++;
    turn%=2;
    for(ll i = 0; i < b; i++,turn++,turn%=2){
        if(v2.empty()) break;
        if(turn){
            for(ll j = 0; j < a; j++){
                v[i][j] = v2.back();
                v2.pop_back();
            }
        }else{
            for(ll j = a-1; j >= 0; j--){
                v[i][j] = v2.back();
                v2.pop_back();
            }
        }

    }
    cout<<"YES\n";
    for(ll i = 0; i < v.size(); i++){
        cout<<v[i]<<endl;
    }
}


#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <iostream>

using namespace std;

char s[105][105];

#define h(x) (x >= a ? d : b)

int main(void)
{
	int a, b, c, d, n;
	scanf("%d%d%d%d%d", &a, &b, &c, &d, &n);

	for (int i = 0; i < max(b, d); i++)
		memset(s[i], '.', a + c);

	int x = 0, y = 0, dy = 1;
	if (a % 2 == 1)
	{
		y = b - 1;
		dy = -1;
	}

	for (int i = 0; i < n; i++)
	{
		int t;
		scanf("%d", &t);
		while (t--)
		{
			//      cerr << y << " " << x << " " << i << endl;
			s[y][x] = 'a' + i;
			y += dy;
			if (y < 0)
			{
				y = 0;
				x++;
				dy = 1;
			}
			else if (y >= h(x))
			{
				x++;
				y = h(x) - 1;
				dy = -1;
			}
		}
	}

	puts("YES");

	for (int i = 0; i < max(b, d); i++)
		puts(s[i]);

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> ii;
typedef tuple<int, int, int> iii;

typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ld> vd;
typedef vector<ll> vl;

#define mp make_pair
#define pb push_back
#define f first
#define s second

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int a, b, c, d, n;
    cin >> a >> b >> c >> d >> n;
    vector<vector<char>> arr(max(b, d), vector<char>(a + c, '.'));
    vector<pair<char, int>> colors(n);
    for (int i = 0; i < n; i++) {
        cin >> colors[i].s;
        colors[i].f = i + 'a';
    }

    if (b >= d) {
        if (d % 2 == 0) {
            for (int i = 0; i < d; i++) {
                if (i % 2 == 0) {
                    for (int j = 0; j < a + c; j++) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
                else {
                    for (int j = a + c - 1; j >= 0; j--) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
            }
            for (int i = d; i < b; i++) {
                if (i % 2 == 0) {
                    for (int j = 0; j < a; j++) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
                else {
                    for (int j = a - 1; j >= 0; j--) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
            }
        }
        else {
            for (int i = 0; i < d; i++) {
                if (i % 2) {
                    for (int j = 0; j < a + c; j++) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
                else {
                    for (int j = a + c - 1; j >= 0; j--) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
            }
            for (int i = d; i < b; i++) {
                if (i % 2) {
                    for (int j = 0; j < a; j++) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
                else {
                    for (int j = a - 1; j >= 0; j--) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
            }
        }
    }
    else {
        if (b % 2 == 0) {
            for (int i = 0; i < b; i++) {
                if (i % 2) {
                    for (int j = 0; j < a + c; j++) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
                else {
                    for (int j = a + c - 1; j >= 0; j--) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
            }
            for (int i = b; i < d; i++) {
                if (i % 2) {
                    for (int j = a; j < a + c; j++) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
                else {
                    for (int j = a + c - 1; j >= a; j--) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
            }
        }
        else {
            for (int i = 0; i < b; i++) {
                if (i % 2 == 0) {
                    for (int j = 0; j < a + c; j++) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
                else {
                    for (int j = a + c - 1; j >= 0; j--) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
            }
            for (int i = b; i < d; i++) {
                if (i % 2 == 0) {
                    for (int j = a; j < a + c; j++) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
                else {
                    for (int j = a + c - 1; j >= a; j--) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
            }
        }
    }

    if (colors.size() == 0) {
        cout << "YES" << endl;
        for (auto x : arr) {
            for (auto y : x) cout << y;
            cout << endl;
        }
    }
    else cout << "NO" << endl;
}

/*
USE LONG LONG!!!!
*/


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> ii;
typedef tuple<int, int, int> iii;

typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ld> vd;
typedef vector<ll> vl;

#define mp make_pair
#define pb push_back
#define f first
#define s second

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int a, b, c, d, n;
    cin >> a >> b >> c >> d >> n;
    vector<vector<char>> arr(max(b, d), vector<char>(a + c, '.'));
    vector<pair<char, int>> colors(n);
    for (int i = 0; i < n; i++) {
        cin >> colors[i].s;
        colors[i].f = i + 'a';
    }

    if (b >= d) {
        if (d % 2 == 0) {
            for (int i = 0; i < d; i++) {
                if (i % 2 == 0) {
                    for (int j = 0; j < a + c; j++) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
                else {
                    for (int j = a + c - 1; j >= 0; j--) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
            }
            for (int i = d; i < b; i++) {
                if (i % 2 == 0) {
                    for (int j = 0; j < a; j++) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
                else {
                    for (int j = a - 1; j >= 0; j--) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
            }
        }
        else {
            for (int i = 0; i < d; i++) {
                if (i % 2) {
                    for (int j = 0; j < a + c; j++) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
                else {
                    for (int j = a + c - 1; j >= 0; j--) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
            }
            for (int i = d; i < b; i++) {
                if (i % 2) {
                    for (int j = 0; j < a; j++) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
                else {
                    for (int j = a - 1; j >= 0; j--) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
            }
        }
    }
    else {
        if (b % 2 == 0) {
            for (int i = 0; i < b; i++) {
                if (i % 2) {
                    for (int j = 0; j < a + c; j++) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
                else {
                    for (int j = a + c - 1; j >= 0; j--) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
            }
            for (int i = b; i < d; i++) {
                if (i % 2) {
                    for (int j = a; j < a + c; j++) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
                else {
                    for (int j = a + c - 1; j >= a; j--) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
            }
        }
        else {
            for (int i = 0; i < b; i++) {
                if (i % 2 == 0) {
                    for (int j = 0; j < a + c; j++) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
                else {
                    for (int j = a + c - 1; j >= 0; j--) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
            }
            for (int i = b; i < d; i++) {
                if (i % 2 == 0) {
                    for (int j = a; j < a + c; j++) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
                else {
                    for (int j = a + c - 1; j >= a; j--) {
                        colors.back().s--;
                        arr[i][j] = colors.back().f;
                        if (colors.back().s == 0) colors.pop_back();
                    }
                }
            }
        }
    }

    for (auto x : arr) {
        for (auto y : x) cout << y;
        cout << endl;
    }
}

/*
USE LONG LONG!!!!
*/


/*
@author: sharrad99
*/
#include<bits/stdc++.h>
using namespace std;
int main(){

	#ifndef ONLINE_JUDGE
	freopen("C:\\Users\\sharr\\Documents\\Input.txt", "r", stdin);
	freopen("C:\\Users\\sharr\\Documents\\Output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int a, b, c, d, n; cin >> a >> b >> c >> d >> n;
	vector<int> u(n); for(int &i : u) cin >> i;

	vector<vector<bool>> v(max(b, d), vector<bool>(a + c, false));
	vector<vector<char>> g(max(b, d), vector<char>(a + c, '?'));
	if(b < d) {
		for(int i = b + 1; i < d; i++) {
			for(int j = 0; j < a; j++) {
				v[i][j] = true;
				g[i][j] = '.';
			}
		}
	} else if(b > d) {
		for(int i = d; i < b; i++) {
			for(int j = a; j < a + c; j++) {
				v[i][j] = true;
				g[i][j] = '.';
			}
		}
	} else {
		assert(true);
	}

	for(int x = 0, y = 0, i = 0; i < n; i++) {
		char t = char(i + 'a');
		while(u[i]) {
			v[x][y] = true;
			g[x][y] = t;
			u[i]--;
			if(y + 1 < (a + c) and !v[x][y + 1]) {
				y++;
			} else if(y - 1 >= 0 and !v[x][y - 1]) {
				y--;
			} else {
				x++;
			}
			if(x == max(b, d)) break;
		}
	}
	if(u.back()) {
		cout << "NO\n";
		return 0;
	}

	cout << "YES\n";
	for(auto &x : g) {
		for(auto &y : x) {
			if(y == '?') y = '.';
			cout << y;
		}
		cout << '\n';
	}
}


/*
@author: sharrad99
*/
#include<bits/stdc++.h>
using namespace std;
int main(){

	#ifndef ONLINE_JUDGE
	freopen("C:\\Users\\sharr\\Documents\\Input.txt", "r", stdin);
	freopen("C:\\Users\\sharr\\Documents\\Output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int a, b, c, d, n; cin >> a >> b >> c >> d >> n;
	vector<int> u(n); for(int &i : u) cin >> i;

	vector<vector<char>> g(max(b, d), vector<char>(a + c, '.'));
	if(b < d) {
		int f = 0, x = d - 1, y = (d & 1 ? a + c - 1 : a), i = 0;
		while(true) {
			if(!u[i]) i++;
			if(i == n) {
				cout << "YES\n";
				for(int i = 0; i < max(b, d); i++) {
					for(int j = 0; j < (a + c); j++) {
						cout << g[i][j];
					}
					cout << '\n';
				}
				exit(0);
			}

			if(x < 0) {
				f = 1;
				x++, y--;
			}

			if(x == d) break;
			char ch = char(i + 'a');
			g[x][y] = ch;
			u[i]--;
			if(d & 1) {
				if(x & 1) {
					y--;
				} else {
					y++;
				}
			} else {
				if(x & 1) {
					y++;
				} else {
					y--;
				}
			}

			if(f) {
				if(y < 0) x++, y++;
				if(y >= a) x++, y--;
			} else {
				if(y < a) x--, y++;
				if(y >= (a + c)) x--, y--;
			}
		}
	} else {
		int f = 0, x = b - 1, y = (b & 1 ? a + c - 1 : a), i = 0;
		while(true) {
			if(!u[i]) i++;
			if(i == n) {
				cout << "YES\n";
				for(int i = 0; i < max(b, d); i++) {
					for(int j = 0; j < (a + c); j++) {
						cout << g[i][j];
					}
					cout << '\n';
				}
				exit(0);
			}

			if(x < 0) {
				f = 1;
				x++, y--;
			}

			if(x == b) break;
			if(b & 1) {
				if(x & 1) {
					y++;
				} else {
					y--;
				}
			} else {
				if(x & 1) {
					y--;
				} else {
					y++;
				}
			}

			if(f) {
				if(y < a) x--, y++;
				if(y >= (a + c)) x--, y--;
			} else {
				if(y < 0) x++, y++;
				if(y >= a) x++, y--;
			}
		}
	}
	cout << "NO\n";
}


/*
@author: sharrad99
*/
#include<bits/stdc++.h>
using namespace std;
int main(){

	#ifndef ONLINE_JUDGE
	freopen("C:\\Users\\sharr\\Documents\\Input.txt", "r", stdin);
	freopen("C:\\Users\\sharr\\Documents\\Output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int a, b, c, d, n; cin >> a >> b >> c >> d >> n;
	vector<int> u(n); for(int &i : u) cin >> i;
	vector<vector<char>> g(max(b, d), vector<char>(a + c, '.'));
	if(b < d) {
		int x = d - 1, y = a + c - 1;
		for(int i = 0; i < n; i++) {
			char ch = char(i + 'a');
			while(u[i]) {
				if(x < 0) {
					cout << "NO\n";
					exit(0);
				}

				if(x >= b and y < a) {
					g[x][y] = '.';
				} else {
					g[x][y] = ch;
					u[i]--;
				}

				if((d - x) & 1) y--;
				else y++;

				if(y < 0) x--, y++;
				if(y >= a + c) x--, y--;
			}
		}

		cout << "YES\n";
		for(int i = 0; i < max(b, d); i++) {
			for(int j = 0; j < (a + c); j++) {
				cout << g[i][j];
			}
			cout << '\n';
		}
	} else {
		int x = b - 1, y = 0;
		for(int i = 0; i < n; i++) {
			char ch = char(i + 'a');
			while(u[i]) {
				if(x < 0) {
					cout << "NO\n";
					exit(0);
				}

				if(x >= d and y >= a) {
					g[x][y] = '.';
				} else {
					g[x][y] = ch;
					u[i]--;
				}

				if((b - x) & 1) y++;
				else y--;

				if(y < 0) x--, y++;
				if(y >= a + c) x--, y--;
			}
		}

		cout << "YES\n";
		for(int i = 0; i < max(b, d); i++) {
			for(int j = 0; j < (a + c); j++) {
				cout << g[i][j];
			}
			cout << '\n';
		}
	}
}


/*
@author: sharrad99
*/
#include<bits/stdc++.h>
using namespace std;
int main(){

	#ifndef ONLINE_JUDGE
	freopen("C:\\Users\\sharr\\Documents\\Input.txt", "r", stdin);
	freopen("C:\\Users\\sharr\\Documents\\Output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int a, b, c, d, n; cin >> a >> b >> c >> d >> n;
	vector<int> u(n); for(int &i : u) cin >> i;
	vector<vector<char>> g(max(b, d), vector<char>(a + c, '.'));
	if(b < d) {
		int i = 0;
		for(int p = (d & 1) ^ 1, x = d - 1; ~x; x--, p ^= 1) {
			if(!u[i]) i++;
			if(i == n) break;
			char ch = char(i + 'a');
			if(p) {
				for(int y = a; y < a + c; y++) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			} else {
				for(int y = a + c - 1; y >= a; y--) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			}
		}

		for(int x = 0; x < d; x++) {
			if(x & 1) {
				for(int y = 0; y < a; y++) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			} else {
				for(int y = a - 1; y >= 0; y--) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			}
		}

		if(i >= n) {
			cout << "YES\n";
			for(int i = 0; i < max(b, d); i++) {
				for(int j = 0; j < (a + c); j++) {
					cout << g[i][j];
				}
				cout << '\n';
			}
		} else {
			cout << "NO\n";
		}
	} else {
		int i = 0;
		for(int p = (b & 1), x = b - 1; ~x; x--, p ^= 1) {
			if(p) {
				for(int y = 0; y < a; y++) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			} else {
				for(int y = a - 1; y >= 0; y--) {
					if(!u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			}
		}

		for(int x = 0; x < b; x++) {
			if(x & 1) {
				for(int y = a + c - 1; y >= a; y--) {
					if(!u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			} else {
				for(int y = a; y < a + c; y++) {
					if(!u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			}
		}

		if(i >= n) {
			cout << "YES\n";
			for(int i = 0; i < max(b, d); i++) {
				for(int j = 0; j < (a + c); j++) {
					cout << g[i][j];
				}
				cout << '\n';
			}
		} else {
			cout << "NO\n";
		}
	}
}


/*
@author: sharrad99
*/
#include<bits/stdc++.h>
using namespace std;
int main(){

	#ifndef ONLINE_JUDGE
	freopen("C:\\Users\\sharr\\Documents\\Input.txt", "r", stdin);
	freopen("C:\\Users\\sharr\\Documents\\Output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int a, b, c, d, n; cin >> a >> b >> c >> d >> n;
	vector<int> u(n); for(int &i : u) cin >> i;
	vector<vector<char>> g(max(b, d), vector<char>(a + c, '.'));
	if(b < d) {
		int i = 0;
		for(int x = d - 1; ~x; x--) {
			if(!u[i]) i++;
			if(i == n) break;
			char ch = char(i + 'a');
			int p = ((x & 1 ^ d & 1) ^ 1);
			if(p) {
				for(int y = a; y < a + c; y++) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			} else {
				for(int y = a + c - 1; y >= a; y--) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			}
		}

		for(int x = 0; x < d; x++) {
			if(x & 1) {
				for(int y = a - 1; y >= 0; y--) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			} else {
				for(int y = 0; y < a; y++) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			}
		}

		if(i >= n) {
			cout << "YES\n";
			for(int i = 0; i < max(b, d); i++) {
				for(int j = 0; j < (a + c); j++) {
					cout << g[i][j];
				}
				cout << '\n';
			}
		} else {
			cout << "NO\n";
		}
	} else {
		int i = 0;
		for(int x = b - 1; ~x; x--) {
			int p = ((x & 1 ^ b & 1) ^ 1);
			if(p) {
				for(int y = 0; y < a; y++) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			} else {
				for(int y = a - 1; y >= 0; y--) {
					if(!u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			}
		}

		for(int x = 0; x < b; x++) {
			if(x & 1) {
				for(int y = a + c - 1; y >= a; y--) {
					if(!u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			} else {
				for(int y = a; y < a + c; y++) {
					if(!u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			}
		}

		if(i >= n) {
			cout << "YES\n";
			for(int i = 0; i < max(b, d); i++) {
				for(int j = 0; j < (a + c); j++) {
					cout << g[i][j];
				}
				cout << '\n';
			}
		} else {
			cout << "NO\n";
		}
	}
}


/*
@author: sharrad99
*/
#include<bits/stdc++.h>
using namespace std;
int main(){

	#ifndef ONLINE_JUDGE
	freopen("C:\\Users\\sharr\\Documents\\Input.txt", "r", stdin);
	freopen("C:\\Users\\sharr\\Documents\\Output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int a, b, c, d, n; cin >> a >> b >> c >> d >> n;
	vector<int> u(n); for(int &i : u) cin >> i;

	vector<vector<bool>> v(max(b, d), vector<bool>(a + c, false));
	vector<vector<char>> g(max(b, d), vector<char>(a + c, '?'));
	if(b < d) {
		for(int i = b + 1; i < d; i++) {
			for(int j = 0; j < a; j++) {
				v[i][j] = true;
				g[i][j] = '.';
			}
		}
	} else if(b > d) {
		for(int i = d; i < b; i++) {
			for(int j = a; j < a + c; j++) {
				v[i][j] = true;
				g[i][j] = '.';
			}
		}
	} else {
		assert(true);
	}

	cout << a + c << '\n';
	for(int x = 0, y = 0, i = 0; i < n; i++) {
		char t = char(i + 'a');
		while(u[i]) {
			v[x][y] = true;
			g[x][y] = t;
			u[i]--;
			if(y + 1 < (a + c) and !v[x][y + 1]) {
				y++;
			} else if(y - 1 >= 0 and !v[x][y - 1]) {
				y--;
			} else {
				x++;
			}
			if(x == max(b, d)) break;
		}
	}
	if(u.back()) {
		cout << "NO\n";
		return 0;
	}

	cout << "YES\n";
	for(auto &x : g) {
		for(auto &y : x) {
			if(y == '?') y = '.';
			cout << y;
		}
		cout << '\n';
	}
}


/*
@author: sharrad99
*/
#include<bits/stdc++.h>
using namespace std;
int main(){

	#ifndef ONLINE_JUDGE
	freopen("C:\\Users\\sharr\\Documents\\Input.txt", "r", stdin);
	freopen("C:\\Users\\sharr\\Documents\\Output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int a, b, c, d, n; cin >> a >> b >> c >> d >> n;
	vector<int> u(n); for(int &i : u) cin >> i;
	vector<vector<char>> g(max(b, d), vector<char>(a + c, '.'));
	if(b < d) {
		int i = 0;
		for(int x = d - 1; ~x; x--) {
			if(!u[i]) i++;
			if(i == n) break;
			char ch = char(i + 'a');
			int p = ((x & 1 ^ d & 1) ^ 1);
			if(p) {
				for(int y = a; y < a + c; y++) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			} else {
				for(int y = a + c - 1; y >= a; y--) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			}
		}

		for(int x = 0; x < d; x++) {
			if(x & 1) {
				for(int y = 0; y < a; y++) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			} else {
				for(int y = a - 1; y >= 0; y--) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			}
		}

		if(i >= n) {
			cout << "YES\n";
			for(int i = 0; i < max(b, d); i++) {
				for(int j = 0; j < (a + c); j++) {
					cout << g[i][j];
				}
				cout << '\n';
			}
		} else {
			cout << "NO\n";
		}
	} else {
		int i = 0;
		for(int x = b - 1; ~x; x--) {
			int p = ((x & 1 ^ b & 1) ^ 1);
			if(p) {
				for(int y = 0; y < a; y++) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			} else {
				for(int y = a - 1; y >= 0; y--) {
					if(!u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			}
		}

		for(int x = 0; x < b; x++) {
			if(x & 1) {
				for(int y = a + c - 1; y >= a; y--) {
					if(!u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			} else {
				for(int y = a; y < a + c; y++) {
					if(!u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			}
		}

		if(i >= n) {
			cout << "YES\n";
			for(int i = 0; i < max(b, d); i++) {
				for(int j = 0; j < (a + c); j++) {
					cout << g[i][j];
				}
				cout << '\n';
			}
		} else {
			cout << "NO\n";
		}
	}
}


/*
@author: sharrad99
*/
#include<bits/stdc++.h>
using namespace std;
int main(){

	#ifndef ONLINE_JUDGE
	freopen("C:\\Users\\sharr\\Documents\\Input.txt", "r", stdin);
	freopen("C:\\Users\\sharr\\Documents\\Output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int a, b, c, d, n; cin >> a >> b >> c >> d >> n;
	vector<int> u(n); for(int &i : u) cin >> i;
	vector<vector<char>> g(max(b, d), vector<char>(a + c, '.'));
	if(b < d) {
		int i = 0;
		for(int x = d - 1; ~x; x--) {
			if(!u[i]) i++;
			if(i == n) break;
			char ch = char(i + 'a');
			int p = (x & 1 ^ d & 1);
			if(p) {
				for(int y = a; y < a + c; y++) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			} else {
				for(int y = a + c - 1; y >= a; y--) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			}
		}

		for(int x = 0; x < d; x++) {
			if(x & 1) {
				for(int y = 0; y < a; y++) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			} else {
				for(int y = a - 1; y >= 0; y--) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			}
		}

		if(i >= n) {
			cout << "YES\n";
			for(int i = 0; i < max(b, d); i++) {
				for(int j = 0; j < (a + c); j++) {
					cout << g[i][j];
				}
				cout << '\n';
			}
		} else {
			cout << "NO\n";
		}
	} else {
		int i = 0;
		for(int x = b - 1; ~x; x--) {
			int p = ((x & 1 ^ b & 1) ^ 1);
			if(p) {
				for(int y = 0; y < a; y++) {
					if(i < n and !u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			} else {
				for(int y = a - 1; y >= 0; y--) {
					if(!u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			}
		}

		for(int x = 0; x < b; x++) {
			if(x & 1) {
				for(int y = a + c - 1; y >= a; y--) {
					if(!u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			} else {
				for(int y = a; y < a + c; y++) {
					if(!u[i]) i++;
					if(i >= n) break;
					char ch = char(i + 'a');
					u[i]--;
					g[x][y] = ch;
					if(i < n and !u[i]) i++;
					if(i >= n) break;
				}
			}
		}

		if(i >= n) {
			cout << "YES\n";
			for(int i = 0; i < max(b, d); i++) {
				for(int j = 0; j < (a + c); j++) {
					cout << g[i][j];
				}
				cout << '\n';
			}
		} else {
			cout << "NO\n";
		}
	}
}


/*
@author: sharrad99
*/
#include<bits/stdc++.h>
using namespace std;
int main(){

	#ifndef ONLINE_JUDGE
	freopen("C:\\Users\\sharr\\Documents\\Input.txt", "r", stdin);
	freopen("C:\\Users\\sharr\\Documents\\Output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int n; cin >> n;
	vector<string> guesses(n);
	vector<int> bulls(n), cows(n);
	for(int i = 0; i < n; i++) {
		cin >> guesses[i] >> bulls[i] >> cows[i];
	}

	auto noneEqual = [] (char a, char b, char c, char d) {
		if(a == b) return false;
		if(a == c) return false;
		if(a == d) return false;
		if(b == c) return false;
		if(b == d) return false;
		if(c == d) return false;
		return true;
	};

	string res;
	for(char a = '0'; a <= '9'; a++) {
		for(char b = '0'; b <= '9'; b++) {
			for(char c = '0'; c <= '9'; c++) {
				for(char d = '0'; d <= '9'; d++) {
					if(noneEqual(a, b, c, d)) {
						string candidate;
						candidate += a;
						candidate += b;
						candidate += c;
						candidate += d;

						bool fg = true;
						for(int i = 0; i < n; i++) {
							bitset<4> guessidx, candidateidx;
							int cbulls = 0, ccows = 0;
							for(int k = 0; k < 4; k++) {
								if(guesses[i][k] == candidate[k]) {
									cbulls++;
									guessidx.set(k);
									candidateidx.set(k);
								}
							}

							for(int k = 0; k < 4; k++) {
								if(!candidateidx.test(k)) {
									for(int t = 0; t < 4; t++) {
										if(!guessidx.test(t) and guesses[i][t] == candidate[k]) {
											ccows++;
											guessidx.set(t);
											candidateidx.set(k);
										}
									}
								}
							}

							fg &= (bulls[i] == cbulls and cows[i] == ccows);
						}

						if(fg) {
							res += candidate;
						}
					}
				}
			}
		}
	}

	if(res.empty()) cout << "Incorrect data\n";
	else if(res.length() > 4) cout << "Need more data\n";
	else cout << res << '\n';
}


//Bismillah

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef double dl;

#define PB push_back
#define F first
#define S second
#define MP make_pair
#define endl '\n'
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mid(l,r) ((r+l)/2)
#define left(node) (node*2)
#define right(node) (node*2+1)
#define mx_int_prime 999999937

const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;
#define MOD 1000000007

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define sqr(a) ((a) * (a))

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename T >
ostream &operator << ( ostream & os, const multiset< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}

bool ok;
int ar[27],r,col,idx=1;
char ch[101][101];
void solve()
{
    for(int j=1;j<=col;j++){
        if(ok){
            for(int i=1;i<=r;i++){
                if(ch[i][j]=='.') continue;
                else{
                    while(ar[idx]==0) idx++;
                   // dbg(idx,ar[idx]);
                    ar[idx]--;
                    ch[i][j]=('a'+idx-1);
                }
            }
            ok= !ok;
        }else{
            for(int i=r;i>=1;i--){
                if(ch[i][j]=='.') continue;
                else{
                    while(ar[idx]==0) idx++;
                   // dbg(idx,ar[idx]);
                    ar[idx]--;
                    ch[i][j]=('a'+idx-1);
                }
            }
            ok =!ok;
        }
    }
}
int main()
{
    optimize();
    cout<<"YES"<<endl;
    int a,b,c,d,n;
    cin>>a>>b>>c>>d>>n;
    for(int i=1;i<=n;i++) cin>>ar[i];
    r=max(b,d),col=a+c;

    if(d<b){
        for(int i=d+1;i<=r;i++){
            for(int j=a+1;j<=col;j++) ch[i][j]='.';
        }
    }else{
        for(int i=b+1;i<=r;i++){
            for(int j=1;j<=a;j++) ch[i][j]='.';
        }
    }
    if(a&1) ok=0;
    else ok=1;
    solve();
    for(int i=1;i<=r;i++){
        for(int j=1;j<=col;j++) cout<<ch[i][j];
        cout<<endl;
    }

    return 0;
}


//Bismillah

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef double dl;

#define PB push_back
#define F first
#define S second
#define MP make_pair
#define endl '\n'
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mid(l,r) ((r+l)/2)
#define left(node) (node*2)
#define right(node) (node*2+1)
#define mx_int_prime 999999937

const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;
#define MOD 1000000007

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define sqr(a) ((a) * (a))

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename T >
ostream &operator << ( ostream & os, const multiset< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}

bool ok;
int ar[27],r,col,idx=1;
char ch[101][101];
void solve()
{
    for(int j=1;j<=col;j++){
        if(ok){
            for(int i=1;i<=r;i++){
                if(ch[i][j]=='.') continue;
                else{
                    while(ar[idx]==0) idx++;
                   // dbg(idx,ar[idx]);
                    ar[idx]--;
                    ch[i][j]=('a'+idx-1);
                }
            }
            ok= !ok;
        }else{
            for(int i=r;i>=1;i--){
                if(ch[i][j]=='.') continue;
                else{
                    while(ar[idx]==0) idx++;
                   // dbg(idx,ar[idx]);
                    ar[idx]--;
                    ch[i][j]=('a'+idx-1);
                }
            }
            ok =!ok;
        }
    }
}
int main()
{
    optimize();
    cout<<"YES"<<endl;
    int a,b,c,d,n;
    cin>>a>>b>>c>>d>>n;
    for(int i=1;i<=n;i++) cin>>ar[i];
    r=max(b,d),col=a+c;

    dbg(r,col);
    for(int i=1;i<=r;i++){
        for(int j=1;j<=col;j++) ch[i][j]='1';
    }
    if(b!=d){
        if(d<b){
            for(int i=d+1;i<=r;i++){
                for(int j=a+1;j<=col;j++) ch[i][j]='.';
            }
            if(a&1) ok=0;
            else ok=1;
            solve();
        }else{ //b<d
            for(int i=b+1;i<=r;i++){
                for(int j=1;j<=a;j++) ch[i][j]='.';
            }
            if(a&1) ok=0;
            else ok=1;
            solve();
        }
    }

    for(int i=1;i<=r;i++){
        for(int j=1;j<=col;j++) cout<<ch[i][j];
        cout<<endl;
    }

    return 0;
}


#include <algorithm>
#include <iostream>
#include <iomanip>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <memory>
#include <cstring>
#include <deque>
#include <cmath>
#include <cassert>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <numeric>
#include <valarray>
#include "stdlib.h"

#define M_PIl          3.141592653589793238462643383279502884L /* pi */
#define ll long long
#define ull unsigned long long
#define lld long double

//#define EXEC_TIME

using namespace std;

void solve() {
    ll a,b,c,d,n;
    cin >> a;
    cin >> b;
    cin >> c;
    cin >> d;
    cin >> n;

    vector<ll> parties;
    ll elemsSum = 0;
    for (ll i = 0; i < n; ++i) {
        ll v;
        cin >> v;
        parties.push_back(v);
        elemsSum += v;
    }
    if (elemsSum > a*b + c*d) {
        cout << "NO\n";
        return;
    }

    ll h = max(b, d);
    ll w = a+c;
    vector<string> field; // field[i][j],  i - row, j - column
    for (ll i = 0; i < h; ++i) {
        field.push_back(string());
        field.back().resize(w, ' ');
    }
    if (b > d) {
        for (ll i = d; i < b; ++i) {
            for (ll j = a; j < w; ++j) {
                field[i][j] = '.';
            }
        }
    }
    if (d > b) {
        for (ll i = b; i < d; ++i) {
            for (ll j = 0; j < a; ++j) {
                field[i][j] = '.';
            }
        }
    }

    ll cy = h - 1;
    ll cx;
    if (b > d) {
        if ((b-d)%2 == 0) {
            cx = 0;
        } else {
            cx = a - 1;
        }
    } else {
        if ((b-d)%2 == 0) {
            cx = w - 1;
        } else {
            cx = a;
        }
    }

    ll ptr = 0;
    char currParty = 'a';
    while (true) {
        // todo: set value
        field[cy][cx] = currParty;
        parties[ptr] -= 1;
        if (parties[ptr] == 0) {
            ++ptr;
            ++currParty;
        }
        if (ptr >= parties.size()) {
            break;
        }
        bool rightFree = cx < w-1 && field[cy][cx+1] == ' ';
        bool leftFree = cx > 0 && field[cy][cx-1] == ' ';
        bool upFree = cy > 0;
        if (rightFree) {
            cx += 1;
        } else if (leftFree) {
            cx -= 1;
        } else if (upFree) {
            cy -= 1;
        } else {
            break;
        }
    }

    for (const auto& s: field) {
        cout << s << endl;
    }
}

/* ================================================================== */

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout << setprecision (numeric_limits<lld>::digits10 + 1);

#ifdef EXEC_TIME
    clock_t start = clock();
#endif

    int n = 1;
    //cin >> n; // раскоментить если много запросов
    for (ull i = 0; i < n; ++i) {
        solve();
    }

#ifdef EXEC_TIME
    clock_t stop = clock();
    double elapsed = (double) (stop - start) / CLOCKS_PER_SEC;
    printf("\nTime elapsed: %.5f\n", elapsed);
#endif

    return 0;
}


#include <algorithm>
#include <iostream>
#include <iomanip>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <memory>
#include <cstring>
#include <deque>
#include <cmath>
#include <cassert>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <numeric>
#include <valarray>
#include "stdlib.h"

#define M_PIl          3.141592653589793238462643383279502884L /* pi */
#define ll long long
#define ull unsigned long long
#define lld long double

//#define EXEC_TIME

using namespace std;

void solve() {
    ll a,b,c,d,n;
    cin >> a;
    cin >> b;
    cin >> c;
    cin >> d;
    cin >> n;

    vector<ll> parties;
    ll elemsSum = 0;
    for (ll i = 0; i < n; ++i) {
        ll v;
        cin >> v;
        parties.push_back(v);
        elemsSum += v;
    }
    if (elemsSum > a*b + c*d) {
        cout << "NO\n";
        return;
    }

    ll h = max(b, d);
    ll w = a+c;
    vector<string> field; // field[i][j],  i - row, j - column
    for (ll i = 0; i < h; ++i) {
        field.push_back(string());
        field.back().resize(w, ' ');
    }
    if (b > d) {
        for (ll i = d; i < b; ++i) {
            for (ll j = a; j < w; ++j) {
                field[i][j] = '.';
            }
        }
    }
    if (d > b) {
        for (ll i = b; i < d; ++i) {
            for (ll j = 0; j < a; ++j) {
                field[i][j] = '.';
            }
        }
    }

    ll cy = h - 1;
    ll cx;
    if (b > d) {
        if ((b-d)%2 == 0) {
            cx = 0;
        } else {
            cx = a - 1;
        }
    } else {
        if ((b-d)%2 == 0) {
            cx = w - 1;
        } else {
            cx = a;
        }
    }

    ll ptr = 0;
    char currParty = 'a';
    while (true) {
        // todo: set value
        field[cy][cx] = currParty;
        parties[ptr] -= 1;
        if (parties[ptr] == 0) {
            ++ptr;
            ++currParty;
        }
        if (ptr >= parties.size()) {
            break;
        }
        bool rightFree = cx < w-1 && field[cy][cx+1] == ' ';
        bool leftFree = cx > 0 && field[cy][cx-1] == ' ';
        bool upFree = cy > 0;
        if (rightFree) {
            cx += 1;
        } else if (leftFree) {
            cx -= 1;
        } else if (upFree) {
            cy -= 1;
        } else {
            break;
        }
    }

    cout << "YES\n";
    for (const auto& s: field) {
        cout << s << endl;
    }
}

/* ================================================================== */

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout << setprecision (numeric_limits<lld>::digits10 + 1);

#ifdef EXEC_TIME
    clock_t start = clock();
#endif

    int n = 1;
    //cin >> n; // раскоментить если много запросов
    for (ull i = 0; i < n; ++i) {
        solve();
    }

#ifdef EXEC_TIME
    clock_t stop = clock();
    double elapsed = (double) (stop - start) / CLOCKS_PER_SEC;
    printf("\nTime elapsed: %.5f\n", elapsed);
#endif

    return 0;
}


#include<bits/stdc++.h>

#define Input                   freopen("in.txt","r",stdin)
#define Output                  freopen("out.txt","w",stdout)
#define ll                      long long int
#define ull                     unsigned long long int
#define pii                     pair<int,int>
#define pll                     pair<ll,ll>
#define sc                      scanf
#define scin(x)                 sc("%d",&(x))
#define scin2(x,y)              sc("%d %d",&(x),&(y))
#define scln(x)                 sc("%lld",&(x))
#define scln2(x,y)              sc("%lld %lld",&(x),&(y))
#define pf                      printf
#define all(a)                  (a.begin()),(a.end())
#define UNIQUE(X)               (X).erase(unique(all(X)),(X).end())
#define SORT_UNIQUE(c)          (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define ms(a,b)                 memset(a,b,sizeof(a))
#define pb(a)                   push_back(a)
#define mp                      make_pair
#define db                      double
#define EPS                     10E-10
#define ff                      first
#define ss                      second
#define sqr(x)                  (x)*(x)
#define vi                      vector<int>
#define vl                      vector<ll>
#define vii                     vector<vector<int> >
#define vll                     vector<vector<ll> >
#define DBG                     pf("HI\n")
#define MOD                     1000000007
#define CIN                     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define RUN_CASE(t,T)           for(__typeof(t) t=1;t<=T;t++)
#define CASE(t)                 printf("Case %d: ",t)
#define CASEl(t)                printf("Case %d:\n",t)
#define intlimit                2147483690
#define longlimit               9223372036854775800
#define infinity                (1<<28)
#define gcd(a,b)                __gcd(a,b)
#define lcm(a,b)                (a)*(b)/gcd(a,b)
#define mxx                     123456789
#define PI                      2*acos(0.0)
#define rep(i,a,b)              for(__typeof(i) i=a;i<=b;i++)
#define rev(i,a,b)              for(__typeof(i) i=a;i>=b;i--)

using namespace std;

int x[35];
char grid[105][105];

void Solve(int t)
{
    int i,j,k,n,a,b,c,d,row1,col1,row2,col2;
    cin>>a>>b>>c>>d>>n;
    for(i=1 ; i<=n ; i++)
        cin>>x[i];
    col1 = a;
    row1 = b;
    row2 = max(b , d);
    col2 = a+c;
    for(i=1 ; i<=row2 ; i++){
        for(j=1 ; j<=col2 ; j++){
            grid[i][j] = 'X';
            if(i<=row1 && j<=col1)
                continue;
            if(j>col1 && i<=d && j<=a+c)
                continue;
            grid[i][j] = '.';
        }
    }

    if(b >= d){
        if((a+c)%2){
            int pos = 1;
            int cnt = x[pos];
            ///
            int updown = 1;     ///1-down ; 0-up
            i = 1;
            j = a+c;
            while(j >= 1 && pos<=n){
                char ch = 'a'+(pos-1);
                grid[i][j] = ch;
                cnt--;
                if(cnt == 0){
                    pos++;
                    cnt = x[pos];
                }
                if(updown){
                    if(i == min(b , d))
                        j-- , updown^=1;
                    else
                        i++;
                }
                else{
                    if(i == 1)
                        j-- , updown^=1;
                    else
                        i--;
                }
            }
            ///
            updown = 1; ///1-down ; 0 - up
            i = min(b , d)+1;
            j = 1;
            bool fg = 1;
            while(j <= a+c && pos<=n && fg){
                char ch = 'a'+(pos-1);
                grid[i][j] = ch;
                cnt--;
                if(cnt <= 0){
                    pos++;
                    cnt = x[pos];
                }
                if(updown){
                    if(i < max(b , d))
                        i++;
                    else if(j < a)
                        j++ , updown^=1;
                    else
                        fg = 0;
                }
                else{
                    if(i > 1+min(b , d))
                        i--;
                    else if(j < a)
                        j++ , updown^=1;
                    else
                        fg = 0;
                }
            }
        }
        else{
            int pos = 1;
            int cnt = x[pos];
            ///
            int updown = 0; ///1-down ; 0-up
            i = min(b , d);
            j = a+c;
            while(j >= 1 && pos<=n){
                char ch = 'a'+(pos-1);
                grid[i][j] = ch;
                cnt--;
                if(cnt == 0){
                    pos++;
                    cnt = x[pos];
                }
                if(updown){
                    if(i == min(b , d))
                        j-- , updown^=1;
                    else
                        i++;
                }
                else{
                    if(i == 1)
                        j-- , updown^=1;
                    else
                        i--;
                }
            }
            ///
            updown = 1; ///1-down ; 0 - up
            i = 1 + min(b , d);
            j = 1;
            bool fg = 1;
            while(j <= a+c && pos<=n && fg){
                char ch = 'a'+(pos-1);
                grid[i][j] = ch;
                cnt--;
                if(cnt == 0){
                    pos++;
                    cnt = x[pos];
                }
                if(updown){
                    if(i < max(b , d))
                        i++;
                    else if(j < a)
                        j++ , updown^=1;
                    else
                        fg = 0;
                }
                else{
                    if(i > 1+min(b , d))
                        i--;
                    else if(j < a)
                        j++ , updown^=1;
                    else
                        fg = 0;
                }
            }
        }
    }
    else{       ///TYPE-2: Space in lower left side
        if((a+c)%2){
            int pos = 1;
            int cnt = x[pos];
            ///
            int updown = 1;     ///1-down ; 0-up
            i = 1;
            j = 1;
            while(j <= a+c && pos<=n){
                char ch = 'a'+(pos-1);
                grid[i][j] = ch;
//                cout<<i<<' '<<j<<endl;
                cnt--;
                if(cnt == 0){
                    pos++;
                    cnt = x[pos];
                }
                if(updown){
                    if(i == row1)
                        j++ , updown^=1;
                    else
                        i++;
                }
                else{
                    if(i == 1)
                        j++ , updown^=1;
                    else
                        i--;
                }
            }
            ///
            updown = 1; ///1-down ; 0 - up
            i = min(b , d) + 1;
            j = a+c;
            bool fg = 1;
            while(j >= 1 && pos<=n && fg){
                char ch = 'a'+(pos-1);
                grid[i][j] = ch;
                cnt--;
                if(cnt == 0){
                    pos++;
                    cnt = x[pos];
                }
                if(updown){
                    if(i < max(b , d))
                        i++;
                    else if(j > 1)
                        j-- , updown^=1;
                    else
                        fg = 0;
                }
                else{
                    if(i > 1+min(b , d))
                        i--;
                    else if(j > 1)
                        j-- , updown^=1;
                    else
                        fg = 0;
                }
            }
        }
        else{
            int pos = 1;
            int cnt = x[pos];
            ///
            int updown = 0; ///1-down ; 0-up
            i = row1;
            j = 1;
            while(j <= a+c && pos<=n){
                char ch = 'a'+(pos-1);
                grid[i][j] = ch;
                cnt--;
                if(cnt == 0){
                    pos++;
                    cnt = x[pos];
                }
                if(updown){
                    if(i == row1)
                        j++ , updown^=1;
                    else
                        i++;
                }
                else{
                    if(i == 1)
                        j++ , updown^=1;
                    else
                        i--;
                }
            }
            ///
            updown = 1; ///1-down ; 0 - up
            i = 1 + min(b , d);
            j = a+c;
            bool fg = 1;
            while(j >= 1 && pos<=n && fg){
                char ch = 'a'+(pos-1);
                grid[i][j] = ch;
                cnt--;
                if(cnt == 0){
                    pos++;
                    cnt = x[pos];
                }
                if(updown){
                    if(i < max(b , d))
                        i++;
                    else if(j > 1)
                        j-- , updown^=1;
                    else
                        fg = 0;
                }
                else{
                    if(i > 1+min(b , d))
                        i--;
                    else if(j > 1)
                        j-- , updown^=1;
                    else
                        fg = 0;
                }
            }
        }
    }

    pf("YES\n");
    for(i=1 ; i<=row2 ; i++){
        for(j=1 ; j<=col2 ; j++)
            cout<<grid[i][j];
        cout<<endl;
    }
}

int main()
{
    int t,T;
    T = 1;
//    scin(T);
    RUN_CASE(t,T)
    {
        Solve(t);
    }
    return 0;
}


#include<bits/stdc++.h>

#define Input                   freopen("in.txt","r",stdin)
#define Output                  freopen("out.txt","w",stdout)
#define ll                      long long int
#define ull                     unsigned long long int
#define pii                     pair<int,int>
#define pll                     pair<ll,ll>
#define sc                      scanf
#define scin(x)                 sc("%d",&(x))
#define scin2(x,y)              sc("%d %d",&(x),&(y))
#define scln(x)                 sc("%lld",&(x))
#define scln2(x,y)              sc("%lld %lld",&(x),&(y))
#define pf                      printf
#define all(a)                  (a.begin()),(a.end())
#define UNIQUE(X)               (X).erase(unique(all(X)),(X).end())
#define SORT_UNIQUE(c)          (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define ms(a,b)                 memset(a,b,sizeof(a))
#define pb(a)                   push_back(a)
#define mp                      make_pair
#define db                      double
#define EPS                     10E-10
#define ff                      first
#define ss                      second
#define sqr(x)                  (x)*(x)
#define vi                      vector<int>
#define vl                      vector<ll>
#define vii                     vector<vector<int> >
#define vll                     vector<vector<ll> >
#define DBG                     pf("HI\n")
#define MOD                     1000000007
#define CIN                     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define RUN_CASE(t,T)           for(__typeof(t) t=1;t<=T;t++)
#define CASE(t)                 printf("Case %d: ",t)
#define CASEl(t)                printf("Case %d:\n",t)
#define intlimit                2147483690
#define longlimit               9223372036854775800
#define infinity                (1<<28)
#define gcd(a,b)                __gcd(a,b)
#define lcm(a,b)                (a)*(b)/gcd(a,b)
#define mxx                     123456789
#define PI                      2*acos(0.0)
#define rep(i,a,b)              for(__typeof(i) i=a;i<=b;i++)
#define rev(i,a,b)              for(__typeof(i) i=a;i>=b;i--)

using namespace std;
/**     toint, tostring, BigMod, Power , sieve, Primefactorize ,frequency in n!     **/
//ll toint(string s){ll n=0,k=1;for(int i=s.size()-1; i>=0; i--){n += ((s[i]-'0')*k);k*=10;}return n;}
//string tostring(ll x){string s="";while(x){s += (x%10)+'0';x/=10;}reverse(s.begin(),s.end());return s;}
//ll BigMod(ll a,ll b){if(b == 0)return 1%MOD;else if(b%2 == 0){ll temp=BigMod(a,b/2);return ((temp%MOD)*(temp%MOD))%MOD;}else{return ((a%MOD)*BigMod(a,b-1)%MOD)%MOD;}}
//ll Power(ll a,ll n){ll ret=1;for(ll i=1 ; i<=n ; i++)ret = ((ret%MOD)*(a%MOD))%MOD;return ret;}
//bool isPrime(ll n){for(ll i=2 ; i*i<=n ; i++){if(n%i == 0)return 0;}return 1;}
//vector<ll>Prime;
//bool mark[10000003];
//void sieve(ll n){ll i,j;mark[1]=1;for(i=4; i<=n; i+=2)mark[i]=1;Prime.push_back(2);for(i=3; i<=n; i+=2){if(!mark[i]){Prime.push_back(i);if(i*i<=n){for(j=i*i; j<=n; j+=(i*2))mark[j]=1;}}}}
//map<ll,ll>Factor;
//void Primefactorize(ll n){for(ll i=0; i<Prime.size() && Prime[i]*Prime[i]<=n; i++){if(n%Prime[i] == 0){while(n%Prime[i] == 0){Factor[Prime[i]]++;n/=Prime[i];}}}if(n>1){Factor[n]++;}}
//ll frequency(ll n,ll factor)/** Frequency of a factor in n! **/{ll cnt=0;while(n){cnt += (n/factor);n /= factor;}return cnt;}
/**     Order Set       **/
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
//template<typename T> using orderset = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
//orderset<int> s ; //orderset<int>::iterator it ;
//orderset<int> X; //X.insert(1); //X.insert(2); //X.insert(4); //X.insert(8); //X.insert(16);
//cout<<*X.find_by_order(0)<<endl; // 2 //cout<<*X.find_by_order(2)<<endl; // 4 //cout<<*X.find_by_order(4)<<endl; // 16 //cout<<(end(X)==X.find_by_order(6))<<endl; // true
//cout<<X.order_of_key(-5)<<endl;  // 0 //cout<<X.order_of_key(1)<<endl;   // 0 //cout<<X.order_of_key(3)<<endl;   // 2 //cout<<X.order_of_key(4)<<endl;   // 2 //cout<<X.order_of_key(400)<<endl; // 5

/** Debugging Tool **/
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}
///

inline int add(int a, int b) {a += b; return a >= MOD ? a - MOD : a;}
inline int sub(int a, int b) {a -= b; return a < 0 ? a + MOD : a;}
inline int mul(int a, int b) {return (ll) a * b % MOD;}
int Set(int N, int pos) {return  N = N | (1<<pos);}
int Reset(int N, int pos) {return  N = N & ~(1<<pos);}
bool Cheek(int N, int pos) {return  (bool)(N & (1<<pos));}

//string small = "abcdefghijklmnopqrstuvwxyz";
//string capital = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

///------------------Graph Moves-------------------
///const int fx[] = {+1,-1,+0,+0};
///const int fy[] = {+0,+0,+1,-1};
///const int fx[] = {+0,+0,+1,-1,-1,+1,-1,+1}; ///King's move
///const int fy[] = {-1,+1,+0,+0,+1,+1,-1,-1}; ///King's move
///const int fx[] = {-2,-2,-1,-1,+1,+1,+2,+2}; ///Knight's move
///const int fy[] = {-1,+1,-2,+2,-2,+2,-1,+1}; ///Knight's move

int x[35];
char grid[105][105];

void Solve(int t)
{
    int i,j,k,n,a,b,c,d,row1,col1,row2,col2;
    cin>>a>>b>>c>>d>>n;
    for(i=1 ; i<=n ; i++)
        cin>>x[i];
    col1 = a;
    row1 = b;
    row2 = max(b , d);
    col2 = a+c;
    for(i=1 ; i<=row2 ; i++){
        for(j=1 ; j<=col2 ; j++){
            grid[i][j] = 'X';
            if(i<=row1 && j<=col1)
                continue;
            if(j>col1 && i<=d && j<=a+c)
                continue;
            grid[i][j] = '.';
        }
    }

    if(b >= d){
        if((a+c)%2){
            int pos = 1;
            int cnt = x[pos];
            ///
            int updown = 1;     ///1-down ; 0-up
            i = 1;
            j = a+c;
            while(j >= 1 && pos<=n){
                char ch = 'a'+(pos-1);
                grid[i][j] = ch;
                cnt--;
                if(cnt == 0){
                    pos++;
                    cnt = x[pos];
                }
                if(updown){
                    if(i == min(b , d))
                        j-- , updown^=1;
                    else
                        i++;
                }
                else{
                    if(i == 1)
                        j-- , updown^=1;
                    else
                        i--;
                }
            }
            ///
            updown = 1; ///1-down ; 0 - up
            i = min(b , d)+1;
            j = 1;
            while(j <= a+c && pos<=n){
                char ch = 'a'+(pos-1);
                grid[i][j] = ch;
                cnt--;
                if(cnt <= 0){
                    pos++;
                    cnt = x[pos];
                }
                if(updown){
                    if(i >= max(b , d))
                        j++ , updown^=1;
                    else
                        i++;
                }
                else{
                    if(i == 1+min(b , d))
                        j++ , updown^=1;
                    else
                        i--;
                }
            }
        }
        else{
            int pos = 1;
            int cnt = x[pos];
            ///
            int updown = 0; ///1-down ; 0-up
            i = min(b , d);
            j = a+c;
            while(j >= 1 && pos<=n){
                char ch = 'a'+(pos-1);
                grid[i][j] = ch;
                cnt--;
                if(cnt == 0){
                    pos++;
                    cnt = x[pos];
                }
                if(updown){
                    if(i == min(b , d))
                        j-- , updown^=1;
                    else
                        i++;
                }
                else{
                    if(i == 1)
                        j-- , updown^=1;
                    else
                        i--;
                }
            }
            ///
            updown = 1; ///1-down ; 0 - up
            i = 1 + min(b , d);
            j = 1;
            while(j <= a+c && pos<=n){
                char ch = 'a'+(pos-1);
                grid[i][j] = ch;
                cnt--;
                if(cnt == 0){
                    pos++;
                    cnt = x[pos];
                }
                if(updown){
                    if(i >= max(b , d))
                        j++ , updown^=1;
                    else
                        i++;
                }
                else{
                    if(i <= 1 + min(b , d))
                        j++ , updown^=1;
                    else
                        i--;
                }
            }
        }
    }
    else{
        if((a+c)%2){
            int pos = 1;
            int cnt = x[pos];
            ///
            int updown = 1;     ///1-down ; 0-up
            i = 1;
            j = 1;
            while(j <= a+c && pos<=n){
                char ch = 'a'+(pos-1);
                grid[i][j] = ch;
                cnt--;
                if(cnt == 0){
                    pos++;
                    cnt = x[pos];
                }
                if(updown){
                    if(i == row1)
                        j++ , updown^=1;
                    else
                        i++;
                }
                else{
                    if(i == 1)
                        j++ , updown^=1;
                    else
                        i--;
                }
            }
            ///
            updown = 1; ///1-down ; 0 - up
            i = min(b , d) + 1;
            j = a+c;
            while(j >= 1 && pos<=n){
                char ch = 'a'+(pos-1);
                grid[i][j] = ch;
                cnt--;
                if(cnt == 0){
                    pos++;
                    cnt = x[pos];
                }
                if(updown){
                    if(i >= max(b , d))
                        j-- , updown^=1;
                    else
                        i++;
                }
                else{
                    if(i <= min(b , d))
                        j-- , updown^=1;
                    else
                        i--;
                }
            }
        }
        else{
            int pos = 1;
            int cnt = x[pos];
            ///
            int updown = 0; ///1-down ; 0-up
            i = row1;
            j = 1;
            while(j <= a+c && pos<=n){
                char ch = 'a'+(pos-1);
                grid[i][j] = ch;
                cnt--;
                if(cnt == 0){
                    pos++;
                    cnt = x[pos];
                }
                if(updown){
                    if(i == row1)
                        j++ , updown^=1;
                    else
                        i++;
                }
                else{
                    if(i == 1)
                        j++ , updown^=1;
                    else
                        i--;
                }
            }
            ///
            updown = 1; ///1-down ; 0 - up
            i = 1 + min(b , d);
            j = a+c;
            while(j >= 1 && pos<=n){
                char ch = 'a'+(pos-1);
                grid[i][j] = ch;
                cnt--;
                if(cnt == 0){
                    pos++;
                    cnt = x[pos];
                }
                if(updown){
                    if(i >= max(b , d))
                        j-- , updown^=1;
                    else
                        i++;
                }
                else{
                    if(i <= min(b , d))
                        j-- , updown^=1;
                    else
                        i--;
                }
            }
        }
    }

    pf("YES\n");
    for(i=1 ; i<=row2 ; i++){
        for(j=1 ; j<=col2 ; j++)
            cout<<grid[i][j];
        cout<<endl;
    }
}

int main()
{
    int t,T;
    T = 1;
//    scin(T);
    RUN_CASE(t,T)
    {
        Solve(t);
    }
    return 0;
}