#include<bits/stdc++.h>
using namespace std;
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//
//    #pragma GCC optimize("unroll-loops")
//    #pragma GCC optimize("Ofast")
//    #pragma GCC optimize("-O3")
//    #pragma GCC optimize("no-stack-protector")
//    #pragma GCC optimize("fast-math")
//#define LOCAL
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifndef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fi first
#define f first
#define se second
#define s second
#define vi_a vector<int>a;
#define p_b push_back
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ll long long
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ld long double
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p make_pair
#define fast_io cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
#define all(x) x.begin(),x.end()
#define getfiles    ifstream cin("input.txt");ofstream cout("output.txt");
#define pw(x) (1ll << x)
#define sz(x) (ll)x.size()
#define endl "\n"
#define rall(x) x.rbegin(),x.rend()
#define len(a) (ll)a.size()
#define rep(x,l,r) for(ll x=l;x<r;x++)

//using namespace __gnu_pbds;
ld eps = (ld)1 / 1e6;
const ld pi=3.14159265359;
ll inf = 1e18;
ll sqr(ll a) { return a * a; }
ll qb(ll a) { return a * a * a; }
ll gcd(ll a, ll b) { return !a ? b : gcd(b % a, a); }
ll binpow(ll a, ll b, ll mod) { return b ? (b % 2 ? (a * (sqr(binpow(a, b / 2, mod)) % mod)) % mod : sqr(binpow(a, b / 2, mod)) % mod) : 1; }
ll binmult(ll a, ll b, ll mod) { return b ? (b % 2 ? (2 * binmult(a, b / 2, mod) + a) % mod : (2 * binmult(a, b / 2, mod)) % mod) : 0; }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const ll R=1e4;
const ll tx[4]={0,0,-1,1};
const ll ty[4]={-1,1,0,0};
const char rev_to[4]={'E','W','N','S'};
const int N=1e6+1;
signed main(){
    fast_io;
    int a,b,c,d,n;
    cin>>a>>b>>c>>d>>n;
    vector<vector<char>>A(max(b,d),vector<char>(a+c,'.'));
    vector<pii>x(n);
    for(int i=0;i<n;i++){
        cin>>x[i].f;x[i].s=i;
    }
    pii psd;
    sort(all(x));
    psd=x.back();x.pop_back();
    sort(rall(x));
    auto how=[&](){
        int kl=0;
        for(int co=a+c-1;co>=a;co--){
            for(int j=0;j<d;j++){
                if(A[j][co]=='.') kl++;
            }
        }
        return kl;
    };
    auto rev=[&](int l,int r){
        int kl=0;
        for(int co=r;co>=l;co--){
            for(int j=0;j<d/2;j++){
                swap(A[j][co],A[d-j-1][co]);
            }
        }
        return kl;
    };
    int i=0;
    bool tp=1;
    int j=n-2;
    bool ok=0;
    if(how()<=psd.f){
        x.insert(x.begin()+n-1,psd);
        j++;
        psd.f=0;
    }
    for(int co=a+c-1;co>=0;co--){
        while(x[j].f && j>=0){
            if(i==-1){
                tp=1;
                i=0;
//                debug()<<imie(co)<<imie(a);
                break;
            }
            if((co>=a) && i==d){
                tp=0;
                if((co-1)>=a)i=d-1;
                else i=b-1;
                if((co)==a) tp=1,i=0;
                break;
            }
            else if(co<a && i==b){
                tp=0;
                if((co-1)>=a)i=d-1;
                else i=b-1;
                if((co)==a) tp=1,i=0;
                break;
            }
            A[i][co]=char(x[j].s+'a');
            if(tp) i++;
            else i--;
            x[j].f--;
            if(!x[j].f){
                if(how()<=psd.f && psd.f){
                    if(tp==1) ok=1;
                    x.insert(x.begin()+j,psd);
                    psd.f=0;
                }
                else j--;
            }
        }
    }
    if(ok) rev(a,a+c-1);
    cout<<"YES\n";
    for(auto &z : A){
        for(auto &g : z) cout<<g;
        cout<<endl;
    }
    return 0;
}
///stuff you should look for :
/*
9 3
1 4 8 1 2
1 1 9 3 1
2 6
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* read the conditions carefully
	* WRITE STUFF DOWN
    * если WA , то чекер говно, поэтому почекай l8 строчку
    * бфс обновляем
    * не дизморалимся и решаем контест полностью , если не получается с таской,  передыхаем или переходим к некст
*/


#include<bits/stdc++.h>
using namespace std;
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//
//    #pragma GCC optimize("unroll-loops")
//    #pragma GCC optimize("Ofast")
//    #pragma GCC optimize("-O3")
//    #pragma GCC optimize("no-stack-protector")
//    #pragma GCC optimize("fast-math")
//#define LOCAL
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifndef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fi first
#define f first
#define se second
#define s second
#define vi_a vector<int>a;
#define p_b push_back
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ll long long
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ld long double
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p make_pair
#define fast_io cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
#define all(x) x.begin(),x.end()
#define getfiles    ifstream cin("input.txt");ofstream cout("output.txt");
#define pw(x) (1ll << x)
#define sz(x) (ll)x.size()
#define endl "\n"
#define rall(x) x.rbegin(),x.rend()
#define len(a) (ll)a.size()
#define rep(x,l,r) for(ll x=l;x<r;x++)

//using namespace __gnu_pbds;
ld eps = (ld)1 / 1e6;
const ld pi=3.14159265359;
ll inf = 1e18;
ll sqr(ll a) { return a * a; }
ll qb(ll a) { return a * a * a; }
ll gcd(ll a, ll b) { return !a ? b : gcd(b % a, a); }
ll binpow(ll a, ll b, ll mod) { return b ? (b % 2 ? (a * (sqr(binpow(a, b / 2, mod)) % mod)) % mod : sqr(binpow(a, b / 2, mod)) % mod) : 1; }
ll binmult(ll a, ll b, ll mod) { return b ? (b % 2 ? (2 * binmult(a, b / 2, mod) + a) % mod : (2 * binmult(a, b / 2, mod)) % mod) : 0; }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const ll R=1e4;
const ll tx[4]={0,0,-1,1};
const ll ty[4]={-1,1,0,0};
const char rev_to[4]={'E','W','N','S'};
const int N=1e6+1;
signed main(){
    fast_io;
    int a,b,c,d,n;
    cin>>a>>b>>c>>d>>n;
    vector<vector<char>>A(max(b,d),vector<char>(a+c,'.'));
    vector<pii>x(n);
    for(int i=0;i<n;i++){
        cin>>x[i].f;x[i].s=i;
    }
    pii psd;
    sort(all(x));
    psd=x.back();x.pop_back();
    sort(rall(x));
    auto how=[&](){
        int kl=0;
        for(int co=a+c-1;co>=a;co--){
            for(int j=0;j<d;j++){
                if(A[j][co]=='.') kl++;
            }
        }
        return kl;
    };
    auto rev=[&](int l,int r){
        int kl=0;
        for(int co=r;co>=l;co--){
            for(int j=0;j<d/2;j++){
                swap(A[j][co],A[d-j-1][co]);
            }
        }
        return kl;
    };
    int i=0;
    bool tp=1;
    int j=n-2;
    bool ok=0;
    if(how()<=psd.f){
        x.insert(x.begin()+n-1,psd);
        j++;
        psd.f=0;
    }
    for(int co=a+c-1;co>=0;co--){
        while(x[j].f && j>=0){
            if(i==-1){
                tp=1;
                i=0;
//                debug()<<imie(co)<<imie(a);
                break;
            }
            if((co>=a) && i==d){
                tp=0;
                if((co-1)>=a)i=d-1;
                else i=b-1;
                if((co)==a) tp=1,i=0;
                break;
            }
            else if(co<a && i==b){
                tp=0;
                if((co-1)>=a)i=d-1;
                else i=b-1;
                if((co)==a) tp=1,i=0;
                break;
            }
            A[i][co]=char(x[j].s+'a');
            if(tp) i++;
            else i--;
            x[j].f--;
            if(!x[j].f){
                if(how()<=psd.f && psd.f){
                    if(tp==1) ok=1;
                    x.insert(x.begin()+j,psd);
                    psd.f=0;
//                    debug()<<imie(ok);
                }
                else j--;
            }
        }
    }
    if(ok) rev(c,a+c-1);
    cout<<"YES\n";
    for(auto &z : A){
        for(auto &g : z) cout<<g;
        cout<<endl;
    }
    return 0;
}
///stuff you should look for :
/*
9 3
1 4 8 1 2
1 1 9 3 1
2 6
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* read the conditions carefully
	* WRITE STUFF DOWN
    * если WA , то чекер говно, поэтому почекай l8 строчку
    * бфс обновляем
    * не дизморалимся и решаем контест полностью , если не получается с таской,  передыхаем или переходим к некст
*/


#include<bits/stdc++.h>
using namespace std;
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//
//    #pragma GCC optimize("unroll-loops")
//    #pragma GCC optimize("Ofast")
//    #pragma GCC optimize("-O3")
//    #pragma GCC optimize("no-stack-protector")
//    #pragma GCC optimize("fast-math")
//#define LOCAL
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifndef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fi first
#define f first
#define se second
#define s second
#define vi_a vector<int>a;
#define p_b push_back
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ll long long
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ld long double
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p make_pair
#define fast_io cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
#define all(x) x.begin(),x.end()
#define getfiles    ifstream cin("input.txt");ofstream cout("output.txt");
#define pw(x) (1ll << x)
#define sz(x) (ll)x.size()
#define endl "\n"
#define rall(x) x.rbegin(),x.rend()
#define len(a) (ll)a.size()
#define rep(x,l,r) for(ll x=l;x<r;x++)

//using namespace __gnu_pbds;
ld eps = (ld)1 / 1e6;
const ld pi=3.14159265359;
ll inf = 1e18;
ll sqr(ll a) { return a * a; }
ll qb(ll a) { return a * a * a; }
ll gcd(ll a, ll b) { return !a ? b : gcd(b % a, a); }
ll binpow(ll a, ll b, ll mod) { return b ? (b % 2 ? (a * (sqr(binpow(a, b / 2, mod)) % mod)) % mod : sqr(binpow(a, b / 2, mod)) % mod) : 1; }
ll binmult(ll a, ll b, ll mod) { return b ? (b % 2 ? (2 * binmult(a, b / 2, mod) + a) % mod : (2 * binmult(a, b / 2, mod)) % mod) : 0; }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const ll R=1e4;
const ll tx[4]={0,0,-1,1};
const ll ty[4]={-1,1,0,0};
const char rev_to[4]={'E','W','N','S'};
const int N=1e6+1;
signed main(){
    fast_io;
    int a,b,c,d,n;
    cin>>a>>b>>c>>d>>n;
    vector<vector<char>>A(max(b,d),vector<char>(a+c,'.'));
    vector<pii>x(n);
    for(int i=0;i<n;i++){
        cin>>x[i].f;x[i].s=i;
    }
    pii psd;
    sort(all(x));
    psd=x.back();x.pop_back();
    sort(rall(x));
    auto how=[&](){
        int kl=0;
        for(int co=a+c-1;co>=a;co--){
            for(int j=0;j<d;j++){
                if(A[j][co]=='.') kl++;
            }
        }
        return kl;
    };
    auto rev=[&](int l,int r){
        int kl=0;
        for(int co=r;co>=l;co--){
            for(int j=0;j<d/2;j++){
                swap(A[j][co],A[d-j-1][co]);
            }
        }
        return kl;
    };
    int i=0;
    bool tp=1;
    int j=n-2;
    bool ok=0;
    if(how()<=psd.f){
        x.insert(x.begin()+n-1,psd);
        j++;
        psd.f=0;
    }
    for(int co=a+c-1;co>=0;co--){
        while(x[j].f && j>=0){
            if(i==-1){
                tp=1;
                i=0;
//                debug()<<imie(co)<<imie(a);
                if(co==a){
                    tp=0;
                    i=0;
                }
                break;
            }
            if((co>=a) && i==d){
                tp=0;
                if((co-1)>=a)i=d-1;
                else i=b-1;
                if((co)==a) tp=1,i=0;
                break;
            }
            else if(co<a && i==b){
                tp=0;
                if((co-1)>=a)i=d-1;
                else i=b-1;
                if((co)==a) tp=1,i=0;
                break;
            }
            A[i][co]=char(x[j].s+'a');
            if(tp) i++;
            else i--;
            x[j].f--;
            if(!x[j].f){
                if(how()<=psd.f && psd.f){
                    if(tp==1) ok=1;
                    x.insert(x.begin()+j,psd);
                    psd.f=0;
//                    debug()<<imie(ok);
                }
                else j--;
            }
        }
    }
    if(ok) rev(c,a+c-1);
    cout<<"YES\n";
    for(auto &z : A){
        for(auto &g : z) cout<<g;
        cout<<endl;
    }
    return 0;
}
///stuff you should look for :
/*
9 3
1 4 8 1 2
1 1 9 3 1
2 6
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* read the conditions carefully
	* WRITE STUFF DOWN
    * если WA , то чекер говно, поэтому почекай l8 строчку
    * бфс обновляем
    * не дизморалимся и решаем контест полностью , если не получается с таской,  передыхаем или переходим к некст
*/


#include<bits/stdc++.h>
using namespace std;
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//
//    #pragma GCC optimize("unroll-loops")
//    #pragma GCC optimize("Ofast")
//    #pragma GCC optimize("-O3")
//    #pragma GCC optimize("no-stack-protector")
//    #pragma GCC optimize("fast-math")
//#define LOCAL
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifndef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fi first
#define f first
#define se second
#define s second
#define vi_a vector<int>a;
#define p_b push_back
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ll long long
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ld long double
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p make_pair
#define fast_io cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
#define all(x) x.begin(),x.end()
#define getfiles    ifstream cin("input.txt");ofstream cout("output.txt");
#define pw(x) (1ll << x)
#define sz(x) (ll)x.size()
#define endl "\n"
#define rall(x) x.rbegin(),x.rend()
#define len(a) (ll)a.size()
#define rep(x,l,r) for(ll x=l;x<r;x++)

//using namespace __gnu_pbds;
ld eps = (ld)1 / 1e6;
const ld pi=3.14159265359;
ll inf = 1e18;
ll sqr(ll a) { return a * a; }
ll qb(ll a) { return a * a * a; }
ll gcd(ll a, ll b) { return !a ? b : gcd(b % a, a); }
ll binpow(ll a, ll b, ll mod) { return b ? (b % 2 ? (a * (sqr(binpow(a, b / 2, mod)) % mod)) % mod : sqr(binpow(a, b / 2, mod)) % mod) : 1; }
ll binmult(ll a, ll b, ll mod) { return b ? (b % 2 ? (2 * binmult(a, b / 2, mod) + a) % mod : (2 * binmult(a, b / 2, mod)) % mod) : 0; }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const ll R=1e4;
const ll tx[4]={0,0,-1,1};
const ll ty[4]={-1,1,0,0};
const char rev_to[4]={'E','W','N','S'};
const int N=1e6+1;
signed main(){
    fast_io;
    int a,b,c,d,n;
    cin>>a>>b>>c>>d>>n;
    vector<vector<char>>A(max(b,d),vector<char>(a+c,'.'));
    vector<pii>x(n);
    for(int i=0;i<n;i++){
        cin>>x[i].f;x[i].s=i;
    }
    pii psd;
    sort(all(x));
    psd=x.back();x.pop_back();
    sort(rall(x));
    auto how=[&](){
        int kl=0;
        for(int co=a+c-1;co>=a;co--){
            for(int j=0;j<d;j++){
                if(A[j][co]=='.') kl++;
            }
        }
        return kl;
    };
    auto rev=[&](){
        int kl=0;
        for(int co=a+c-1;co>=a;co--){
            for(int j=0;j<d;j++){
                swap(A[j][co],A[d-j-1][co]);
            }
        }
        return kl;
    };
    int i=0;
    bool tp=1;
    int j=n-2;
    bool ok=0;
    if(how()<=psd.f){
        x.insert(x.begin()+n-1,psd);
//        debug()<<imie(ok)<<imie(tp)<<imie(ok);
        j++;
        psd.f=0;
    }
//    debug()<<imie(x);
    for(int co=a+c-1;co>=0;co--){
        while(x[j].f && j>=0){
//            debug()<<imie(x[j])<<imie(x);
            if(i==-1){
                tp=1;
                i=0;
                break;
            }
            if((co>=a) && i==d){
                tp=0;
                if((co-1)>=a)i=d-1;
                else i=b-1;
                break;
            }
            else if(co<a && i==b){
                tp=0;
                if((co-1)>=a)i=d-1;
                else i=b-1;
                break;
            }
            A[i][co]=char(x[j].s+'a');
            if(tp) i++;
            else i--;
            x[j].f--;
            if(!x[j].f){
                if(how()<=psd.f && psd.f){
//                    if(tp==1) ok=1;
                    x.insert(x.begin()+j,psd);
                    psd.f=0;
//                    debug()<<imie(x)<<imie(ok);
                }
                else j--;
            }
//            debug()<<imie(x)<<imie(psd)<<imie(A);
        }
//        if(!x[j]) j--;
    }
//    if(ok) rev();
    cout<<"YES\n";
    for(auto &z : A){
        for(auto &g : z) cout<<g;
        cout<<endl;
    }
    return 0;
}
///stuff you should look for :
/*
9 3
1 4 8 1 2
1 1 9 3 1
2 6
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* read the conditions carefully
	* WRITE STUFF DOWN
    * если WA , то чекер говно, поэтому почекай l8 строчку
    * бфс обновляем
    * не дизморалимся и решаем контест полностью , если не получается с таской,  передыхаем или переходим к некст
*/


#include<bits/stdc++.h>
using namespace std;
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//
//    #pragma GCC optimize("unroll-loops")
//    #pragma GCC optimize("Ofast")
//    #pragma GCC optimize("-O3")
//    #pragma GCC optimize("no-stack-protector")
//    #pragma GCC optimize("fast-math")
//#define LOCAL
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifndef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fi first
#define f first
#define se second
#define s second
#define vi_a vector<int>a;
#define p_b push_back
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ll long long
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ld long double
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p make_pair
#define fast_io cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
#define all(x) x.begin(),x.end()
#define getfiles    ifstream cin("input.txt");ofstream cout("output.txt");
#define pw(x) (1ll << x)
#define sz(x) (ll)x.size()
#define endl "\n"
#define rall(x) x.rbegin(),x.rend()
#define len(a) (ll)a.size()
#define rep(x,l,r) for(ll x=l;x<r;x++)

//using namespace __gnu_pbds;
ld eps = (ld)1 / 1e6;
const ld pi=3.14159265359;
ll inf = 1e18;
ll sqr(ll a) { return a * a; }
ll qb(ll a) { return a * a * a; }
ll gcd(ll a, ll b) { return !a ? b : gcd(b % a, a); }
ll binpow(ll a, ll b, ll mod) { return b ? (b % 2 ? (a * (sqr(binpow(a, b / 2, mod)) % mod)) % mod : sqr(binpow(a, b / 2, mod)) % mod) : 1; }
ll binmult(ll a, ll b, ll mod) { return b ? (b % 2 ? (2 * binmult(a, b / 2, mod) + a) % mod : (2 * binmult(a, b / 2, mod)) % mod) : 0; }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const ll R=1e4;
const ll tx[4]={0,0,-1,1};
const ll ty[4]={-1,1,0,0};
const char rev_to[4]={'E','W','N','S'};
const int N=1e6+1;
signed main(){
    fast_io;
    int a,b,c,d,n;
    cin>>a>>b>>c>>d>>n;
    vector<vector<char>>A(max(b,d),vector<char>(a+c,'.'));
    vector<pii>x(n);
    for(int i=0;i<n;i++){
        cin>>x[i].f;x[i].s=i;
    }
    sort(all(x));
    int i=0;
    bool tp=1;
    int j=n-1;
    if(b>d){
        for(int co=a+c-1;co>=0;co--){
            while(x[j].f && j>=0){
                if(i==-1){
                    tp=1;
                    i=0;
                    break;
                }
                if((co>=a) && i==d){
                    tp=0;
                    if((co-1)>=a)i=d-1;
                    else i=b-1;
                    break;
                }
                else if(co<a && i==b){
                    tp=0;
                    if((co-1)>=a)i=d-1;
                    else i=b-1;
                    break;
                }
                A[i][co]=char(x[j].s+'a');
                if(tp) i++;
                else i--;
                x[j].f--;
                if(!x[j].f)j--;
    //            debug()<<imie(A);
            }
    //        if(!x[j]) j--;
        }
    }else{

         for(int co=0;co<a+c;co++){
            while(x[j].f && j>=0){
                if(i==-1){
                    tp=1;
                    i=0;
                    break;
                }
                if((co>=a) && i==d){
                    if(A[0][co]==char(x[j].s+'a')){
                        tp=1;
                        i=0;
                        continue;
                    }
                    tp=0;
                    if((co+1)>=a)i=d-1;
                    else i=b-1;
                    break;
                }
                else if(co<a && i==b){
                    if(A[0][co]==char(x[j].s+'a')){
                        tp=1;
                        i=0;
                        continue;
                    }
                    tp=0;
                    if((co+1)>=a)i=d-1;
                    else i=b-1;
                    break;
                }
                A[i][co]=char(x[j].s+'a');
                if(tp) i++;
                else i--;
                x[j].f--;
                if(!x[j].f)j--;
    //            debug()<<imie(A);
            }
    //        if(!x[j]) j--;
        }
    }
    cout<<"YES\n";
    for(auto &z : A){
        for(auto &g : z) cout<<g;
        cout<<endl;
    }
    return 0;
}
///stuff you should look for :
/*
9 3
1 4 8 1 2
1 1 9 3 1
2 6
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* read the conditions carefully
	* WRITE STUFF DOWN
    * если WA , то чекер говно, поэтому почекай l8 строчку
    * бфс обновляем
    * не дизморалимся и решаем контест полностью , если не получается с таской,  передыхаем или переходим к некст
*/


#include<bits/stdc++.h>
using namespace std;
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//
//    #pragma GCC optimize("unroll-loops")
//    #pragma GCC optimize("Ofast")
//    #pragma GCC optimize("-O3")
//    #pragma GCC optimize("no-stack-protector")
//    #pragma GCC optimize("fast-math")
//#define LOCAL
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifndef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fi first
#define f first
#define se second
#define s second
#define vi_a vector<int>a;
#define p_b push_back
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ll long long
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ld long double
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p make_pair
#define fast_io cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
#define all(x) x.begin(),x.end()
#define getfiles    ifstream cin("input.txt");ofstream cout("output.txt");
#define pw(x) (1ll << x)
#define sz(x) (ll)x.size()
#define endl "\n"
#define rall(x) x.rbegin(),x.rend()
#define len(a) (ll)a.size()
#define rep(x,l,r) for(ll x=l;x<r;x++)

//using namespace __gnu_pbds;
ld eps = (ld)1 / 1e6;
const ld pi=3.14159265359;
ll inf = 1e18;
ll sqr(ll a) { return a * a; }
ll qb(ll a) { return a * a * a; }
ll gcd(ll a, ll b) { return !a ? b : gcd(b % a, a); }
ll binpow(ll a, ll b, ll mod) { return b ? (b % 2 ? (a * (sqr(binpow(a, b / 2, mod)) % mod)) % mod : sqr(binpow(a, b / 2, mod)) % mod) : 1; }
ll binmult(ll a, ll b, ll mod) { return b ? (b % 2 ? (2 * binmult(a, b / 2, mod) + a) % mod : (2 * binmult(a, b / 2, mod)) % mod) : 0; }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const ll R=1e4;
const ll tx[4]={0,0,-1,1};
const ll ty[4]={-1,1,0,0};
const char rev_to[4]={'E','W','N','S'};
const int N=1e6+1;
signed main(){
    fast_io;
    int a,b,c,d,n;
    cin>>a>>b>>c>>d>>n;
    vector<vector<char>>A(max(b,d),vector<char>(a+c,'.'));
    vector<pii>x(n);
    for(int i=0;i<n;i++){
        cin>>x[i].f;x[i].s=i;
    }
    pii psd;
    sort(all(x));
    psd=x.back();x.pop_back();
    sort(rall(x));
    auto how=[&](){
        int kl=0;
        for(int co=a+c-1;co>=a;co--){
            for(int j=0;j<d;j++){
                if(A[j][co]=='.') kl++;
            }
        }
        return kl;
    };
    auto rev=[&](){
        int kl=0;
        for(int co=a+c-1;co>=a;co--){
            for(int j=0;j<d/2;j++){
                swap(A[j][co],A[d-j-1][co]);
            }
        }
        return kl;
    };
    int i=0;
    bool tp=1;
    int j=n-2;
    bool ok=0;
    if(how()<=psd.f){
        x.insert(x.begin()+n-1,psd);
//        debug()<<imie(ok)<<imie(tp)<<imie(ok);
        j++;
        psd.f=0;
    }
//    debug()<<imie(x);
    for(int co=a+c-1;co>=0;co--){
        while(x[j].f && j>=0){
//            debug()<<imie(x[j])<<imie(x);
            if(i==-1){
                tp=1;
                i=0;
                break;
            }
            if((co>=a) && i==d){
                tp=0;
                if((co-1)>=a)i=d-1;
                else i=b-1;
                break;
            }
            else if(co<a && i==b){
                tp=0;
                if((co-1)>=a)i=d-1;
                else i=b-1;
                break;
            }
            A[i][co]=char(x[j].s+'a');
            if(tp) i++;
            else i--;
            x[j].f--;
            if(!x[j].f){
                if(how()<=psd.f && psd.f){
                    if(tp==1) ok=1;
                    x.insert(x.begin()+j,psd);
                    psd.f=0;
                    debug()<<imie(ok);
                }
                else j--;
            }
//            debug()<<imie(x)<<imie(psd)<<imie(A);
        }
//        if(!x[j]) j--;
    }
    if(ok) rev();
    cout<<"YES\n";
    for(auto &z : A){
        for(auto &g : z) cout<<g;
        cout<<endl;
    }
    return 0;
}
///stuff you should look for :
/*
9 3
1 4 8 1 2
1 1 9 3 1
2 6
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* read the conditions carefully
	* WRITE STUFF DOWN
    * если WA , то чекер говно, поэтому почекай l8 строчку
    * бфс обновляем
    * не дизморалимся и решаем контест полностью , если не получается с таской,  передыхаем или переходим к некст
*/


#include<bits/stdc++.h>
using namespace std;
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//
//    #pragma GCC optimize("unroll-loops")
//    #pragma GCC optimize("Ofast")
//    #pragma GCC optimize("-O3")
//    #pragma GCC optimize("no-stack-protector")
//    #pragma GCC optimize("fast-math")
//#define LOCAL
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifndef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fi first
#define f first
#define se second
#define s second
#define vi_a vector<int>a;
#define p_b push_back
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ll long long
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ld long double
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p make_pair
#define fast_io cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
#define all(x) x.begin(),x.end()
#define getfiles    ifstream cin("input.txt");ofstream cout("output.txt");
#define pw(x) (1ll << x)
#define sz(x) (ll)x.size()
#define endl "\n"
#define rall(x) x.rbegin(),x.rend()
#define len(a) (ll)a.size()
#define rep(x,l,r) for(ll x=l;x<r;x++)

//using namespace __gnu_pbds;
ld eps = (ld)1 / 1e6;
const ld pi=3.14159265359;
ll inf = 1e18;
ll sqr(ll a) { return a * a; }
ll qb(ll a) { return a * a * a; }
ll gcd(ll a, ll b) { return !a ? b : gcd(b % a, a); }
ll binpow(ll a, ll b, ll mod) { return b ? (b % 2 ? (a * (sqr(binpow(a, b / 2, mod)) % mod)) % mod : sqr(binpow(a, b / 2, mod)) % mod) : 1; }
ll binmult(ll a, ll b, ll mod) { return b ? (b % 2 ? (2 * binmult(a, b / 2, mod) + a) % mod : (2 * binmult(a, b / 2, mod)) % mod) : 0; }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const ll R=1e4;
const ll tx[4]={0,0,-1,1};
const ll ty[4]={-1,1,0,0};
const char rev_to[4]={'E','W','N','S'};
const int N=1e6+1;
signed main(){
    fast_io;
    int a,b,c,d,n;
    cin>>a>>b>>c>>d>>n;
    vector<vector<char>>A(max(b,d),vector<char>(a+c,'.'));
    vector<pii>x(n);
    for(int i=0;i<n;i++){
        cin>>x[i].f;x[i].s=i;
    }
    sort(all(x));
    int i=0;
    bool tp=1;
    int j=n-1;
    if(b>d){
        for(int co=a+c-1;co>=0;co--){
            while(x[j].f && j>=0){
                if(i==-1){
                    tp=1;
                    i=0;
                    break;
                }
                if((co>=a) && i==d){
                    tp=0;
                    if((co-1)>=a)i=d-1;
                    else i=b-1;
                    break;
                }
                else if(co<a && i==b){
                    tp=0;
                    if((co-1)>=a)i=d-1;
                    else i=b-1;
                    break;
                }
                A[i][co]=char(x[j].s+'a');
                if(tp) i++;
                else i--;
                x[j].f--;
                if(!x[j].f)j--;
    //            debug()<<imie(A);
            }
    //        if(!x[j]) j--;
        }
    }else{

         for(int co=0;co<a+c;co++){
            while(x[j].f && j>=0){
                if(i==-1){
                    tp=1;
                    i=0;
                    break;
                }
                if((co>=a) && i==d){
                    if(A[0][co]==char(x[j].s+'a')){
                        tp=1;
                        i=0;
                        continue;
                    }
                    tp=0;
                    if((co+1)>=a)i=d-1;
                    else i=b-1;
                    break;
                }
                else if(co<a && i==b){
                    tp=0;
                    if((co+1)>=a)i=d-1;
                    else i=b-1;
                    break;
                }
                A[i][co]=char(x[j].s+'a');
                if(tp) i++;
                else i--;
                x[j].f--;
                if(!x[j].f)j--;
    //            debug()<<imie(A);
            }
    //        if(!x[j]) j--;
        }
    }
    cout<<"YES\n";
    for(auto &z : A){
        for(auto &g : z) cout<<g;
        cout<<endl;
    }
    return 0;
}
///stuff you should look for :
/*
9 3
1 4 8 1 2
1 1 9 3 1
2 6
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* read the conditions carefully
	* WRITE STUFF DOWN
    * если WA , то чекер говно, поэтому почекай l8 строчку
    * бфс обновляем
    * не дизморалимся и решаем контест полностью , если не получается с таской,  передыхаем или переходим к некст
*/


#include <bits/stdc++.h>

using namespace std;

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

#define endl "\n"

const ll INF = 1e15;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1.0);

mt19937 rng((int) chrono::steady_clock::now().time_since_epoch().count());

const int N = 55;

char G[3 * N][3 * N];
ll a, b, c, d, n, x[N], h[N];

pll nxt(int i, int j, bool flag = 0) {
    if (flag) {
        if (i == 0 && (j & 1))
            return {i, j + 1};
        if (i == h[j] - 1 && (j & 1) == 0)
            return {i, j + 1};
        if (j & 1)
            return {i - 1, j};
        return {i + 1, j};
    } else {
        if (i == 0 && (j & 1) == 0)
            return {i, j + 1};
        if (i == h[j] - 1 && (j & 1))
            return {i, j + 1};
        if (j & 1)
            return {i + 1, j};
        return {i - 1, j};
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);

    cin >> a >> b >> c >> d >> n;

    for (int i = 0; i < n; ++i)
        cin >> x[i];

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

    for (int i = 0; i < a; ++i)
        h[i] = b;
    for (int i = a; i < a + c; ++i)
        h[i] = d;

    bool flag = (a > c ? b : d + a) & 1;

    cout << "YES" << endl;

    int idx = 0;
    pll cur = {0, 0};
    if (flag == 0)
        cur = {h[0] - 1, 0};
    for (int t = 0; t < a * b + c * d; ++t) {
        int i = cur.first, j = cur.second;
         //cout << i << " " << j << " " << idx << endl;
        G[i][j] = char(idx + 'a');
        cout << G[i][j] << endl;
        --x[idx];
        if (x[idx] == 0) ++idx;
        cur = nxt(i, j, flag);
    }

    for (int i = 0; i < max(b, d); ++i) {
        for (int j = 0; j < a + c; ++j)
            cout << G[i][j];
        cout << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

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

#define endl "\n"

const ll INF = 1e15;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1.0);

mt19937 rng((int) chrono::steady_clock::now().time_since_epoch().count());

const int N = 55;

char G[3 * N][3 * N];
ll a, b, c, d, n, x[N], h[N];

pll nxt(int i, int j, bool flag = 0) {
    if (flag == 0) {
        if (i == 0 && (j & 1))
            return {i, j + 1};
        if (i == h[j] - 1 && (j & 1) == 0)
            return {i, j + 1};
        if (j & 1)
            return {i - 1, j};
        return {i + 1, j};
    } else {
        if (i == 0 && (j & 1) == 0)
            return {i, j + 1};
        if (i == h[j] - 1 && (j & 1))
            return {i, j + 1};
        if (j & 1)
            return {i + 1, j};
        return {i - 1, j};
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);

    cin >> a >> b >> c >> d >> n;

    for (int i = 0; i < n; ++i)
        cin >> x[i];

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

    for (int i = 0; i < a; ++i)
        h[i] = b;
    for (int i = a; i < a + c; ++i)
        h[i] = d;

    bool flag = a & 1;

    cout << "YES" << endl;

    int idx = 0;
    pll cur = {0, 0};
    if (flag)
        cur = {h[0] - 1, 0};
    for (int t = 0; t < a * b + c * d; ++t) {
        int i = cur.first, j = cur.second;
        //cout << i << " " << j << " " << h[j] << endl;
        G[i][j] = char(idx + 'a');
        --x[idx];
        if (x[idx] == 0) ++idx;
        cur = nxt(i, j, flag);
    }

    for (int i = 0; i < max(b, d); ++i) {
        for (int j = 0; j < a + c; ++j)
            cout << G[i][j];
        cout << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

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

#define endl "\n"

const ll INF = 1e15;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1.0);

mt19937 rng((int) chrono::steady_clock::now().time_since_epoch().count());

const int N = 55;

char G[3 * N][3 * N];
ll a, b, c, d, n, x[N], h[N];

pll nxt(int i, int j, bool flag = 0) {
    if (flag) {
        if (i == 0 && (j & 1))
            return {i, j + 1};
        if (i == h[j] - 1 && (j & 1) == 0)
            return {i, j + 1};
        if (j & 1)
            return {i - 1, j};
        return {i + 1, j};
    } else {
        if (i == 0 && ((j + h[j]) & 1) == 0)
            return {i, j + 1};
        if (i == h[j] - 1 && ((j + h[j]) & 1))
            return {i, j + 1};
        if (j & 1)
            return {i + 1, j};
        return {i - 1, j};
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);

    cin >> a >> b >> c >> d >> n;

    for (int i = 0; i < n; ++i)
        cin >> x[i];

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

    for (int i = 0; i < a; ++i)
        h[i] = b;
    for (int i = a; i < a + c; ++i)
        h[i] = d;

    bool flag = (a > c ? b : d + a) & 1;

    cout << "YES" << endl;

    int idx = 0;
    pll cur = {0, 0};
    if (flag == 0)
        cur = {h[0] - 1, 0};
    for (int t = 0; t < a * b + c * d; ++t) {
        int i = cur.first, j = cur.second;
        //cout << i << " " << j << " " << h[j] << endl;
        G[i][j] = char(idx + 'a');
        --x[idx];
        if (x[idx] == 0) ++idx;
        cur = nxt(i, j, flag);
    }

    for (int i = 0; i < max(b, d); ++i) {
        for (int j = 0; j < a + c; ++j)
            cout << G[i][j] << " ";
        cout << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

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

#define endl "\n"

const ll INF = 1e15;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1.0);

mt19937 rng((int) chrono::steady_clock::now().time_since_epoch().count());

const int N = 55;

char G[3 * N][3 * N];
ll a, b, c, d, n, x[N], h[N];

pll nxt(int i, int j, bool flag = 0) {
    if (flag == 0) {
        if (i == 0 && (j & 1))
            return {i, j + 1};
        if (i == h[j] - 1 && (j & 1) == 0)
            return {i, j + 1};
        if (j & 1)
            return {i - 1, j};
        return {i + 1, j};
    } else {
        if (i == 0 && (j & 1) == 0)
            return {i, j + 1};
        if (i == h[j] - 1 && (j & 1))
            return {i, j + 1};
        if (j & 1)
            return {i + 1, j};
        return {i - 1, j};
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);

    cin >> a >> b >> c >> d >> n;

    for (int i = 0; i < n; ++i)
        cin >> x[i];

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

    for (int i = 0; i < a; ++i)
        h[i] = b;
    for (int i = a; i < a + c; ++i)
        h[i] = d;

    bool flag = (a > c ? b : d + a) & 1;

    cout << "YES" << endl;

    int idx = 0;
    pll cur = {0, 0};
    if (flag)
        cur = {h[0] - 1, 0};
    for (int t = 0; t < a * b + c * d; ++t) {
        int i = cur.first, j = cur.second;
        //cout << i << " " << j << endl;
        G[i][j] = char(idx + 'a');
        --x[idx];
        if (x[idx] == 0) ++idx;
        cur = nxt(i, j, flag);
    }

    for (int i = 0; i < max(b, d); ++i) {
        for (int j = 0; j < a + c; ++j)
            cout << G[i][j];
        cout << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

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

#define endl "\n"

const ll INF = 1e15;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1.0);

mt19937 rng((int) chrono::steady_clock::now().time_since_epoch().count());

const int N = 55;

char G[3 * N][3 * N];
ll a, b, c, d, n, x[N], h[N];

pll nxt(int i, int j, bool flag = 0) {
    if (flag) {
        if (i == 0 && (j & 1))
            return {i, j + 1};
        if (i == h[j] - 1 && (j & 1) == 0)
            return {i, j + 1};
        if (j & 1)
            return {i - 1, j};
        return {i + 1, j};
    } else {
        if (i == 0 && (j & 1) == 0)
            return {i, j + 1};
        if (i == h[j] - 1 && (j & 1))
            return {i, j + 1};
        if (j & 1)
            return {i + 1, j};
        return {i - 1, j};
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);

    cin >> a >> b >> c >> d >> n;

    for (int i = 0; i < n; ++i)
        cin >> x[i];

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

    for (int i = 0; i < a; ++i)
        h[i] = b;
    for (int i = a; i < a + c; ++i)
        h[i] = d;

    bool flag = (a > c ? b : d + a) & 1;

    cout << "YES" << endl;

    int idx = 0;
    pll cur = {0, 0};
    if (flag == 0)
        cur = {h[0] - 1, 0};
    for (int t = 0; t < a * b + c * d; ++t) {
        int i = cur.first, j = cur.second;
         //cout << i << " " << j << " " <   < idx << endl;
        G[i][j] = char(idx + 'a');
        //cout << G[i][j] << endl;
        --x[idx];
        if (x[idx] == 0) ++idx;
        cur = nxt(i, j, flag);
    }

    for (int i = 0; i < max(b, d); ++i) {
        for (int j = 0; j < a + c; ++j)
            cout << G[i][j];
        cout << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

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

#define endl "\n"

const ll INF = 1e15;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1.0);

mt19937 rng((int) chrono::steady_clock::now().time_since_epoch().count());

const int N = 55;

char G[3 * N][3 * N];
ll a, b, c, d, n, x[N], h[N * 3];

pll nxt(int i, int j, bool flag = 0) {
    if (flag == 0) {
        if (i == 0 && (j & 1))
            return {i, j + 1};
        if (i == h[j] - 1 && (j & 1) == 0)
            return {i, j + 1};
        if (j & 1)
            return {i - 1, j};
        return {i + 1, j};
    } else {
        if (i == 0 && (j & 1) == 0)
            return {i, j + 1};
        if (i == h[j] - 1 && (j & 1))
            return {i, j + 1};
        if (j & 1)
            return {i + 1, j};
        return {i - 1, j};
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);

    cin >> a >> b >> c >> d >> n;

    for (int i = 0; i < n; ++i)
        cin >> x[i];

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

    for (int i = 0; i < a; ++i)
        h[i] = b;
    for (int i = a; i < a + c; ++i)
        h[i] = d;

    bool flag = a & 1;

    cout << "YES" << endl;

    int idx = 0;
    pll cur = {0, 0};
    if (flag)
        cur = {h[0] - 1, 0};
    for (int t = 0; t < a * b + c * d; ++t) {
        int i = cur.first, j = cur.second;
        //cout << i << " " << j << " " << h[j] << endl;
        G[i][j] = char(idx + 'a');
        --x[idx];
        if (x[idx] == 0) ++idx;
        cur = nxt(i, j, flag);
    }

    for (int i = 0; i < max(b, d); ++i) {
        for (int j = 0; j < a + c; ++j)
            cout << G[i][j];
        cout << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

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

#define endl "\n"

const ll INF = 1e15;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1.0);

mt19937 rng((int) chrono::steady_clock::now().time_since_epoch().count());

const int N = 55;

char G[3 * N][3 * N];
ll a, b, c, d, n, x[N], h[N];

pll nxt(int i, int j, bool flag = 0) {
    if (flag) {
        if (i == 0 && (j & 1))
            return {i, j + 1};
        if (i == h[j] - 1 && (j & 1) == 0)
            return {i, j + 1};
        if (j & 1)
            return {i - 1, j};
        return {i + 1, j};
    } else {
        if (i == 0 && ((j + h[j]) & 1) == 0)
            return {i, j + 1};
        if (i == h[j] - 1 && ((j + h[j]) & 1))
            return {i, j + 1};
        if (j & 1)
            return {i + 1, j};
        return {i - 1, j};
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);

    cin >> a >> b >> c >> d >> n;

    for (int i = 0; i < n; ++i)
        cin >> x[i];

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

    for (int i = 0; i < a; ++i)
        h[i] = b;
    for (int i = a; i < a + c; ++i)
        h[i] = d;

    bool flag = (a > c ? b : d + a) & 1;

    cout << "YES" << endl;

    int idx = 0;
    pll cur = {0, 0};
    if (flag == 0)
        cur = {h[0] - 1, 0};
    for (int t = 0; t < a * b + c * d; ++t) {
        int i = cur.first, j = cur.second;
        // cout << i << " " << j << " " << h[j] << endl;
        G[i][j] = char(idx + 'a');
        --x[idx];
        if (x[idx] == 0) ++idx;
        cur = nxt(i, j, flag);
    }

    for (int i = 0; i < max(b, d); ++i) {
        for (int j = 0; j < a + c; ++j)
            cout << G[i][j];
        cout << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db long double
#define pb push_back
#define pii pair<int,int>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define mi map<int,int>
#define ml map<ll,ll>
#define mii map<pii,int>
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mod 1000000007
#define MAX 4294967295
#define EPS 1e-9
#define io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define MAXN 15000005
#define inf 8e18
#define PI acos(-1.0)
#define int long long

int a,b,c,d,n,cnt[30],ans[105][105];

void set_it(int &i,int &j,int &dir){
    if(dir){
        if(j<a+c-1 && ans[i][j+1]!=0) j++;
        else i++, dir=0;
    }
    else{
        if(j>0 && ans[i][j-1]!=0) j--;
        else i++, dir=1;
    }
}

signed main(){
    io;
    //freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    cin>>a>>b>>c>>d>>n;
    for(int i=0;i<n;i++) cin>>cnt[i];
    memset(ans,-1,sizeof(ans));
    if(b>d){
        for(int i=d;i<b;i++){
            for(int j=a;j<a+c;j++) ans[i][j]=0;
        }
    }
    else{
        for(int i=b;i<d;i++){
            for(int j=0;j<a;j++) ans[i][j]=0;
        }
    }
    int x=0,y,di;
    if((b>d&&d%2==1)||(b<d&&b%2==0)) y=a+c-1,di=0;
    else y=0,di=1;
    for(int i=0;i<n;i++){
        int tmp=0;
        pair<pii,int> nex;
        while(tmp<cnt[i]){
            //cout<<x<<" "<<y<<endl;
            ans[x][y]=i+1;
            set_it(x,y,di);
            tmp++;
        }
    }
    cout<<"YES\n";
    for(int i=0;i<max(b,d);i++){
        for(int j=0;j<a+c;j++){
            if(ans[i][j]) cout<<(char)('a'+ans[i][j]-1);
            else cout<<'.';
        }
        cout<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db long double
#define pb push_back
#define pii pair<int,int>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define mi map<int,int>
#define ml map<ll,ll>
#define mii map<pii,int>
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mod 1000000007
#define MAX 4294967295
#define EPS 1e-9
#define io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define MAXN 15000005
#define inf 8e18
#define PI acos(-1.0)
#define int long long

int a,b,c,d,n,cnt[30],ans[55][55];

pair<pii,int> set_it(int i,int j,int dir,int num){
    //cout<<i<<" "<<j<<endl;
    ans[i][j]=num;
    if(dir){
        if(j<a+c-1 && ans[i][j+1]!=0) j++;
        else if(j==a+c-1){
            i++;
            dir=0;
            while(j>=0 && ans[i][j]==0) j--;
        }
        else{
            j++;
            while(j<a+c && ans[i][j]==0) j++;
            if(j>=a+c){
                dir=0;
                i++;
                j=a+c-1;
                while(j>=0 && ans[i][j]==0) j--;
            }
        }
    }
    else{
        if(j>0 && ans[i][j-1]!=0) j--;
        else if(j==0){
            dir=1;
            i++;
            while(j<a+c && ans[i][j]==0) j++;
        }
        else{
            j--;
            while(j>=0 && ans[i][j]==0) j--;
            if(j<=0){
                dir=0;
                i++;
                if(j<0) j=0;
                while(j<a+c && ans[i][j]==0) j++;
            }
        }
    }
    return {{i,j},dir};
}

signed main(){
    io;
    //freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    cin>>a>>b>>c>>d>>n;
    for(int i=0;i<n;i++) cin>>cnt[i];
    memset(ans,-1,sizeof(ans));
    if(b>d){
        for(int i=d;i<b;i++){
            for(int j=a;j<a+c;j++) ans[i][j]=0;
        }
    }
    else{
        for(int i=b;i<d;i++){
            for(int j=0;j<a;j++) ans[i][j]=0;
        }
    }
    int x=0,y,di;
    if((b>d&&d%2==1)||(b<d&&b%2==0)) y=a+c-1,di=0;
    else y=0,di=1;
    for(int i=0;i<n;i++){
        int tmp=0;
        pair<pii,int> nex;
        while(tmp<cnt[i]){
            nex = set_it(x,y,di,i+1);
            x=nex.fi.fi; y=nex.fi.se; di=nex.se;
            tmp++;
        }
        x=nex.fi.fi; y=nex.fi.se; di=nex.se;
    }
    cout<<"YES\n";
    for(int i=0;i<max(b,d);i++){
        for(int j=0;j<a+c;j++){
            if(ans[i][j]) cout<<(char)('a'+ans[i][j]-1);
            else cout<<'.';
        }
        cout<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db long double
#define pb push_back
#define pii pair<int,int>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define mi map<int,int>
#define ml map<ll,ll>
#define mii map<pii,int>
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mod 1000000007
#define MAX 4294967295
#define EPS 1e-9
#define io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define MAXN 15000005
#define inf 8e18
#define PI acos(-1.0)
#define int long long

int a,b,c,d,n,cnt[30],ans[55][55];

void set_it(int &i,int &j,int &dir){
    if(dir){
        if(j<a+c-1 && ans[i][j+1]!=0) j++;
        else i++, dir=0;
    }
    else{
        if(j>0 && ans[i][j-1]!=0) j--;
        else i++, dir=1;
    }
}

signed main(){
    io;
    //freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    cin>>a>>b>>c>>d>>n;
    for(int i=0;i<n;i++) cin>>cnt[i];
    memset(ans,-1,sizeof(ans));
    if(b>d){
        for(int i=d;i<b;i++){
            for(int j=a;j<a+c;j++) ans[i][j]=0;
        }
    }
    else{
        for(int i=b;i<d;i++){
            for(int j=0;j<a;j++) ans[i][j]=0;
        }
    }
    int x=0,y,di;
    if((b>d&&d%2==1)||(b<d&&b%2==0)) y=a+c-1,di=0;
    else y=0,di=1;
    for(int i=0;i<n;i++){
        int tmp=0;
        pair<pii,int> nex;
        while(tmp<cnt[i]){
            //cout<<x<<" "<<y<<endl;
            ans[x][y]=i+1;
            set_it(x,y,di);
            tmp++;
        }
    }
    cout<<"YES\n";
    for(int i=0;i<max(b,d);i++){
        for(int j=0;j<a+c;j++){
            if(ans[i][j]) cout<<(char)('a'+ans[i][j]-1);
            else cout<<'.';
        }
        cout<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define Q int t, q; scanf("%d", &t); for(q=1; q<=t; q++)
typedef long long int lli;
typedef pair<lli, lli> pli;

int main()
{
    int a, b, c, d, n;
    cin >> a >> b >> c >> d >> n;
    int arr[n];
    for(auto &x: arr)cin >> x;
    vector<string> v(max(b, d), string(a+c, '-'));
    int pos = 0;
    if(b > d){
        for(int i=b-1; i>=d; i--){
            for(int j=a+c-1; j>=a; j--){
                v[i][j] = '.';
            }
        }

        if((b-d)%2){
            for(int i=b-1; i>=0; ){
                for(int j=a+c-1; j>=0; j--){
                    if(v[i][j] == '-'){
                        if(arr[pos]){
                            v[i][j] = 'a'+pos;
                        }
                        else{
                            pos++;
                            v[i][j] = 'a'+pos;
                        }
                        arr[pos]--;
                    }
                }
                i--;
                if(i < 0) break;
                for(int j=0; j<a+c; j++){
                    if(v[i][j] == '-'){
                        if(arr[pos]){
                            v[i][j] = 'a'+pos;
                        }
                        else{
                            pos++;
                            v[i][j] = 'a'+pos;
                        }
                        arr[pos]--;
                    }
                }
                i--;
            }
        }
        else{
            for(int i=b-1; i>=0; ){
                for(int j=0; j<a+c; j++){
                    if(v[i][j] == '-'){
                        if(arr[pos]){
                            v[i][j] = 'a'+pos;
                        }
                        else{
                            pos++;
                            v[i][j] = 'a'+pos;
                        }
                        arr[pos]--;
                    }
                }
                i--;
                if(i < 0) break;
                for(int j=a+c-1; j>=0; j--){
                    if(v[i][j] == '-'){
                        if(arr[pos]){
                            v[i][j] = 'a'+pos;
                        }
                        else{
                            pos++;
                            v[i][j] = 'a'+pos;
                        }
                        arr[pos]--;
                    }
                }
                i--;
            }
        }
    }
    else{
        for(int i=d-1; i>=b; i--){
            for(int j=0; j<a; j++){
                v[i][j] = '.';
            }
        }
        if((d-b)%2){
            for(int i=d-1; i>=0; ){
                for(int j=0; j<a+c; j++){
                    if(v[i][j] == '-'){
                        if(arr[pos]){
                            v[i][j] = 'a'+pos;
                        }
                        else{
                            pos++;
                            v[i][j] = 'a'+pos;
                        }
                        arr[pos]--;
                    }
                }
                i--;
                if(i < 0) break;
                for(int j=a+c-1; j>=0; j--){
                    if(v[i][j] == '-'){
                        if(arr[pos]){
                            v[i][j] = 'a'+pos;
                        }
                        else{
                            pos++;
                            v[i][j] = 'a'+pos;
                        }
                        arr[pos]--;
                    }
                }
                i--;
            }
        }
        else{
            for(int i=d-1; i>=0; ){
                for(int j=a+c-1; j>=0; j--){
                    if(v[i][j] == '-'){
                        if(arr[pos]){
                            v[i][j] = 'a'+pos;
                        }
                        else{
                            pos++;
                            v[i][j] = 'a'+pos;
                        }
                        arr[pos]--;
                    }
                }
                i--;
                if(i < 0) break;
                for(int j=0; j<a+c; j++){
                    if(v[i][j] == '-'){
                        if(arr[pos]){
                            v[i][j] = 'a'+pos;
                        }
                        else{
                            pos++;
                            v[i][j] = 'a'+pos;
                        }
                        arr[pos]--;
                    }
                }
                i--;
            }
        }
    }
    printf("YES\n");
    for(auto x: v)cout << x << endl;

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define Q int t, q; scanf("%d", &t); for(q=1; q<=t; q++)
typedef long long int lli;
typedef pair<lli, lli> pli;

int main()
{
    int a, b, c, d, n;
    cin >> a >> b >> c >> d >> n;
    int arr[n];
    for(auto &x: arr)cin >> x;
    vector<string> v(max(b, d), string(a+c, '-'));
    int pos = 0;
    if(b > d){
        for(int i=b-1; i>=d; i--){
            for(int j=a+c-1; j>=a; j--){
                v[i][j] = '.';
            }
        }

        if((b-d)%2){
            for(int i=b-1; i>=0; ){
                for(int j=a+c-1; j>=0; j--){
                    if(v[i][j] == '-'){
                        if(arr[pos]){
                            v[i][j] = 'a'+pos;
                        }
                        else{
                            pos++;
                            v[i][j] = 'a'+pos;
                        }
                        arr[pos]--;
                    }
                }
                i--;
                if(i < 0) break;
                for(int j=0; j<a+c; j++){
                    if(v[i][j] == '-'){
                        if(arr[pos]){
                            v[i][j] = 'a'+pos;
                        }
                        else{
                            pos++;
                            v[i][j] = 'a'+pos;
                        }
                        arr[pos]--;
                    }
                }
                i--;
            }
        }
        else{
            for(int i=b-1; i>=0; ){
                for(int j=0; j<a+c; j++){
                    if(v[i][j] == '-'){
                        if(arr[pos]){
                            v[i][j] = 'a'+pos;
                        }
                        else{
                            pos++;
                            v[i][j] = 'a'+pos;
                        }
                        arr[pos]--;
                    }
                }
                i--;
                if(i < 0) break;
                for(int j=a+c-1; j>=0; j--){
                    if(v[i][j] == '-'){
                        if(arr[pos]){
                            v[i][j] = 'a'+pos;
                        }
                        else{
                            pos++;
                            v[i][j] = 'a'+pos;
                        }
                        arr[pos]--;
                    }
                }
                i--;
            }
        }
    }
    else{
        for(int i=d-1; i>=b; i--){
            for(int j=0; j<a; j++){
                v[i][j] = '.';
            }
        }
        if((d-b)%2){
            for(int i=d-1; i>=0; ){
                for(int j=0; j<a+c; j++){
                    if(v[i][j] == '-'){
                        if(arr[pos]){
                            v[i][j] = 'a'+pos;
                        }
                        else{
                            pos++;
                            v[i][j] = 'a'+pos;
                        }
                        arr[pos]--;
                    }
                }
                i--;
                if(i < 0) break;
                for(int j=a+c-1; j>=0; j--){
                    if(v[i][j] == '-'){
                        if(arr[pos]){
                            v[i][j] = 'a'+pos;
                        }
                        else{
                            pos++;
                            v[i][j] = 'a'+pos;
                        }
                        arr[pos]--;
                    }
                }
                i--;
            }
        }
        else{
            for(int i=d-1; i>=0; ){
                for(int j=a+c-1; j>=0; j--){
                    if(v[i][j] == '-'){
                        if(arr[pos]){
                            v[i][j] = 'a'+pos;
                        }
                        else{
                            pos++;
                            v[i][j] = 'a'+pos;
                        }
                        arr[pos]--;
                    }
                }
                i--;
                if(i < 0) break;
                for(int j=0; j<a+c; j++){
                    if(v[i][j] == '-'){
                        if(arr[pos]){
                            v[i][j] = 'a'+pos;
                        }
                        else{
                            pos++;
                            v[i][j] = 'a'+pos;
                        }
                        arr[pos]--;
                    }
                }
                i--;
            }
        }
    }
    for(auto x: v)cout << x << endl;

    return 0;
}


/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author jignesh1604
 */

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

using namespace std;

class DDividingIsland {
public:
	void solve(std::istream& in, std::ostream& out) {
	    long long int a , b , c , d , n , i , j , k = 1;
	    in >> a >> b >> c >> d >> n;
	    long long int v[n+1];
	    out << "YES\n";
	    char ans[max(b , d) + 5][a+c + 5];
	    memset(ans , '.' , sizeof(ans));
	    char ch = 'a';
	    for(i = 1 ; i <= n ; i++) in >> v[i];
        for(j = 1 ; j <= a ; j += 2) {
            if(a%2 == 0) {
                for(i = 1 ; i <= b ; i++) {
                    if(v[k] == 0) {
                        k++;
                        ch++;
                        ans[i][j] = ch;
                        v[k]--;
                    }
                    else {
                        ans[i][j] = ch;
                        v[k]--;
                    }
                }
                if(j+1 <= a) {
                    for (i = b; i >= 1; i--) {
                        if (v[k] == 0) {
                            k++;
                            ch++;
                            ans[i][j + 1] = ch;
                            v[k]--;
                        } else {
                            ans[i][j + 1] = ch;
                            v[k]--;
                        }
                    }
                }
            }
            else {
                for(i = b ; i >= 1 ; i--) {
                    if(v[k] == 0) {
                        k++;
                        ch++;
                        ans[i][j] = ch;
                        v[k]--;
                    }
                    else {
                        ans[i][j] = ch;
                        v[k]--;
                    }
                }
                if(j+1 <= a) {
                    for (i = 1; i <= b; i++) {
                        if (v[k] == 0) {
                            k++;
                            ch++;
                            ans[i][j + 1] = ch;
                            v[k]--;
                        } else {
                            ans[i][j + 1] = ch;
                            v[k]--;
                        }
                    }
                }
            }
        }
        for(j = a+1 ; j <= a+c ; j += 2) {
            for(i = 1 ; i <= d ; i++) {
                if(v[k] == 0) {
                    k++;
                    ch++;
                    ans[i][j] = ch;
                    v[k]--;
                }
                else {
                    ans[i][j] = ch;
                    v[k]--;
                }
            }
            for(i = d ; i >= 1 ; i--) {
                if(v[k] == 0) {
                    k++;
                    ch++;
                    ans[i][j+1] = ch;
                    v[k]--;
                }
                else {
                    ans[i][j+1] = ch;
                    v[k]--;
                }
            }
        }

        for(i = 1 ; i <= max(b , d) ; i++) {
            for(j = 1 ; j <= a+c ; j++) {
                    out << ans[i][j];
                }
            out << "\n";
        }
	}
};

int main() {
	DDividingIsland solver;
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


#include <bits/stdc++.h>
#define clr cin.ignore(numeric_limits<streamsize>::max(), '\n')
#define _val(x) cerr << #x << " is " << x << "\n";
#define all(container) container.begin(), container.end()
#define rall(container) container.rbegin(), container.rend()
#define pb push_back
#define mp make_pair
#define X first
#define Y second

using namespace std;

const double eps = 1e-10;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int, int> pii;
typedef vector<pair<int, int> > vpii;
typedef vector<pair<long long, long long> > vpll;
const int INF = 0x3f3f3f3f;
const int MAXN = 1e5+1;

int main(void){
	int a, b, c, d, n;
	scanf("%d %d %d %d %d", &a, &b, &c, &d, &n);
	int arr[n], prefix[n];
	for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
	prefix[0] = arr[0];
	for (int i = 1; i < n; i++) prefix[i] = arr[i] + prefix[i-1];
	char curr = 'a'; int val = 0, lr, pos = 0;
	char sol[max(b, d)][a+c];
	memset(sol, '?', sizeof(sol));
	if (d > b) {
		if (min(b, d) % 2 != 0) lr = 1;
		else lr = 0;
		for (int i = b; i < d; i++)
			for (int j = 0; j < a; j++)
				sol[i][j] = '.';
	} else {
		for (int i = d; i < b; i++)
			for (int j = a; j < a+c; j++)
				sol[i][j] = '.';
		if (min(b, d) % 2 == 0) lr = 1;
		else lr = 0;
	}
	if (lr) {
		for (int i = 0; i < max(b, d); i++) {
			if (i % 2 == 0) {
				for (int j = 0; j < a + c; j++) {
					if (sol[i][j] == '.') continue;
					val += 1;
					if (val > prefix[pos]) {
						pos += 1; curr++;
					}
					sol[i][j] = curr;
				}
			} else {
				for (int j = a + c - 1; j >= 0; j--) {
					if (sol[i][j] == '.') continue;
					val += 1;
					if (val > prefix[pos]) {
						pos += 1; curr++;
					}
					sol[i][j] = curr;
				}
			}
		}
	} else {
		for (int i = 0; i < max(b, d); i++) {
			if (i % 2 != 0) {
				for (int j = 0; j < a + c; j++) {
					if (sol[i][j] == '.') continue;
					val += 1;
					if (val > prefix[pos]) {
						pos += 1; curr++;
					}
					sol[i][j] = curr;
				}
			} else {
				for (int j = a + c - 1; j >= 0; j--) {
					if (sol[i][j] == '.') continue;
					val += 1;
					if (val > prefix[pos]) {
						pos += 1; curr++;
					}
					sol[i][j] = curr;
				}
			}
		}
	}
	printf("YES\n");
	for (int i = 0; i < max(b, d); i++) {
		for (int j = 0; j < a + c; j++) {
			printf("%c", sol[i][j]);
		}
		printf("\n");
	}
	return 0;
}


#include <bits/stdc++.h>
#define clr cin.ignore(numeric_limits<streamsize>::max(), '\n')
#define _val(x) cerr << #x << " is " << x << "\n";
#define all(container) container.begin(), container.end()
#define rall(container) container.rbegin(), container.rend()
#define pb push_back
#define mp make_pair
#define X first
#define Y second

using namespace std;

const double eps = 1e-10;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int, int> pii;
typedef vector<pair<int, int> > vpii;
typedef vector<pair<long long, long long> > vpll;
const int INF = 0x3f3f3f3f;
const int MAXN = 1e5+1;

int main(void){
	int a, b, c, d, n;
	scanf("%d %d %d %d %d", &a, &b, &c, &d, &n);
	int arr[n], prefix[n];
	for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
	prefix[0] = arr[0];
	for (int i = 1; i < n; i++) prefix[i] = arr[i] + prefix[i-1];
	char curr = 'a'; int val = 0, lr, pos = 0;
	char sol[max(b, d)][a+c];
	memset(sol, '?', sizeof(sol));
	if (d > b) {
		if ((d-b) % 2 != 0) lr = 1;
		else lr = 0;
		for (int i = b; i < d; i++)
			for (int j = 0; j < a; j++)
				sol[i][j] = '.';
	} else {
		for (int i = d; i < b; i++)
			for (int j = a; j < a+c; j++)
				sol[i][j] = '.';
		if ((b-d) % 2 == 0) lr = 1;
		else lr = 0;
	}
	if (lr) {
		for (int i = 0; i < max(b, d); i++) {
			if (i % 2 == 0) {
				for (int j = 0; j < a + c; j++) {
					if (sol[i][j] == '.') continue;
					val += 1;
					if (val > prefix[pos]) {
						pos += 1; curr++;
					}
					sol[i][j] = curr;
				}
			} else {
				for (int j = a + c - 1; j >= 0; j--) {
					if (sol[i][j] == '.') continue;
					val += 1;
					if (val > prefix[pos]) {
						pos += 1; curr++;
					}
					sol[i][j] = curr;
				}
			}
		}
	} else {
		for (int i = 0; i < max(b, d); i++) {
			if (i % 2 != 0) {
				for (int j = 0; j < a + c; j++) {
					if (sol[i][j] == '.') continue;
					val += 1;
					if (val > prefix[pos]) {
						pos += 1; curr++;
					}
					sol[i][j] = curr;
				}
			} else {
				for (int j = a + c - 1; j >= 0; j--) {
					if (sol[i][j] == '.') continue;
					val += 1;
					if (val > prefix[pos]) {
						pos += 1; curr++;
					}
					sol[i][j] = curr;
				}
			}
		}
	}
	printf("YES\n");
	for (int i = 0; i < max(b, d); i++) {
		for (int j = 0; j < a + c; j++) {
			printf("%c", sol[i][j]);
		}
		printf("\n");
	}
	return 0;
}


#include <bits/stdc++.h>
#define clr cin.ignore(numeric_limits<streamsize>::max(), '\n')
#define _val(x) cerr << #x << " is " << x << "\n";
#define all(container) container.begin(), container.end()
#define rall(container) container.rbegin(), container.rend()
#define pb push_back
#define mp make_pair
#define X first
#define Y second

using namespace std;

const double eps = 1e-10;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int, int> pii;
typedef vector<pair<int, int> > vpii;
typedef vector<pair<long long, long long> > vpll;
const int INF = 0x3f3f3f3f;
const int MAXN = 1e5+1;

int main(void){
	int a, b, c, d, n;
	scanf("%d %d %d %d %d", &a, &b, &c, &d, &n);
	int arr[n], prefix[n];
	for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
	prefix[0] = arr[0];
	for (int i = 1; i < n; i++) prefix[i] = arr[i] + prefix[i-1];
	char curr = 'a'; int val = 0, lr, pos = 0;
	char sol[max(b, d)][a+c];
	memset(sol, '?', sizeof(sol));
	if (d > b) {
		if ((d-b) % 2 != 0) lr = 1;
		else lr = 0;
		for (int i = b; i < d; i++)
			for (int j = 0; j < a; j++)
				sol[i][j] = '.';
	} else {
		for (int i = d; i < b; i++)
			for (int j = a; j < a+c; j++)
				sol[i][j] = '.';
		if ((b-d) % 2 == 0) lr = 1;
		else lr = 0;
	}
	if (lr) {
		for (int i = 0; i < max(b, d); i++) {
			if (i % 2 == 0) {
				for (int j = 0; j < a + c; j++) {
					if (sol[i][j] == '.') continue;
					val += 1;
					if (val > prefix[pos]) {
						pos += 1; curr++;
					}
					sol[i][j] = curr;
				}
			} else {
				for (int j = a + c - 1; j >= 0; j--) {
					if (sol[i][j] == '.') continue;
					val += 1;
					if (val > prefix[pos]) {
						pos += 1; curr++;
					}
					sol[i][j] = curr;
				}
			}
		}
	} else {
		for (int i = 0; i < max(b, d); i++) {
			if (i % 2 != 0) {
				for (int j = 0; j < a + c; j++) {
					if (sol[i][j] == '.') continue;
					val += 1;
					if (val > prefix[pos]) {
						pos += 1; curr++;
					}
					sol[i][j] = curr;
				}
			} else {
				for (int j = a + c - 1; j >= 0; j--) {
					if (sol[i][j] == '.') continue;
					val += 1;
					if (val > prefix[pos]) {
						pos += 1; curr++;
					}
					sol[i][j] = curr;
				}
			}
		}
	}
	for (int i = 0; i < max(b, d); i++) {
		for (int j = 0; j < a + c; j++) {
			printf("%c", sol[i][j]);
		}
		printf("\n");
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define clr(a,b) memset(a,b,sizeof(a))
#define all(v) ((v).begin()),((v).end())
#define read freopen("input.in", "rt", stdin);
#define write freopen("output.in", "wt", stdout);
#define fastIO cout << fixed << setprecision(0), ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
double const EPS = 1e-8, PI = acos(-1);
const int N = 4e5 + 9, OO = 1e9 + 9;

vector<int> vec;
char arr[209][209];
int a, b, c, d, n, x, cur = 0;

void path1() {
  for (int i = 0; i < c  && cur != (int)vec.size(); ++i) {
    if (i & 1) {
      for (int j = 0; j < a && cur != (int)vec.size(); ++j) {
        if(arr[i][j] == '?')
          continue;
        arr[i][j] = 'a' + cur;
        --vec[cur];
        if(vec[cur] == 0) {
          ++cur;
        }
      }
    } else {
      for (int j = a - 1; j >= 0 && cur != (int)vec.size(); --j) {
        if(arr[i][j] == '?')
          continue;
        arr[i][j] = 'a' + cur;
        --vec[cur];
        if(vec[cur] == 0) {
          ++cur;
          if(cur == (int)vec.size())
            break;
        }
      }
    }
  }
}

void path2() {
  for (int i = 0; i < c && cur != (int)vec.size(); ++i) {
    if (i & 1) {
      for (int j = a - 1; j >= 0 && cur != (int)vec.size(); --j) {
        if(arr[i][j] == '?')
          continue;
        arr[i][j] = 'a' + cur;
        --vec[cur];
        if(vec[cur] == 0) {
          ++cur;
          if(cur == (int)vec.size())
            break;
        }
      }
    } else {
      for (int j = 0; j < a && cur != (int)vec.size(); ++j) {
        if(arr[i][j] == '?')
          continue;
        arr[i][j] = 'a' + cur;
        --vec[cur];
        if(vec[cur] == 0) {
          ++cur;
          if(cur == (int)vec.size())
            break;
        }
      }
    }
  }
}

int main() {
  fastIO;
  cin >> a >> b >> c >> d >> n;
  clr(arr, '?');

  for (int i = 0; i < b; ++i) {
    for (int j = 0; j < a; ++j) {
      arr[i][j] = '*';
    }
  }

  for (int i = 0; i < d; ++i) {
    for (int j = 0; j < c; ++j) {
      arr[i][j + a] = '*';
    }
  }

  for (int i = 0; i < n; ++i) {
    cin >> x;
    vec.push_back(x);
  }
  a += c;
  c = max(b, d);

  int dir = (min(b, d) & 1) ? 1 : 0;
  int dir2 = (arr[c-1][0] == '?') ? 1 : 0;
  if(!dir && !dir2) {
    path2();
  } else if(!dir && dir2) {
    path1();
  } else if(dir && dir2) {
    path2();
  } else {
    path1();
  }

  int rem = 0;
  for (int i = 0; i < n; ++i)
    rem += vec[i];
  if(rem > 0) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
    for (int i = 0; i < c; ++i) {
      for (int j = 0; j < a; ++j) {
        if(arr[i][j] == '?' || arr[i][j] == '*')
          arr[i][j] = '.';
        cout << arr[i][j];
      }
      cout << '\n';
    }
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define clr(a,b) memset(a,b,sizeof(a))
#define all(v) ((v).begin()),((v).end())
#define read freopen("input.in", "rt", stdin);
#define write freopen("output.in", "wt", stdout);
#define fastIO cout << fixed << setprecision(0), ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
double const EPS = 1e-8, PI = acos(-1);
const int N = 4e5 + 9, OO = 1e9 + 9;

vector<int> vec;
char arr[59][59];
int a, b, c, d, n, x, cur = 0;

void path1() {
  for (int i = 0; i < c  && cur != (int)vec.size(); ++i) {
    if (i & 1) {
      for (int j = 0; j < a && cur != (int)vec.size(); ++j) {
        if(arr[i][j] == '?')
          continue;
        arr[i][j] = 'a' + cur;
        --vec[cur];
        if(vec[cur] == 0) {
          ++cur;
        }
      }
    } else {
      for (int j = a - 1; j >= 0 && cur != (int)vec.size(); --j) {
        if(arr[i][j] == '?')
          continue;
        arr[i][j] = 'a' + cur;
        --vec[cur];
        if(vec[cur] == 0) {
          ++cur;
          if(cur == (int)vec.size())
            break;
        }
      }
    }
  }
}

void path2() {
  for (int i = 0; i < c && cur != (int)vec.size(); ++i) {
    if (i & 1) {
      for (int j = a - 1; j >= 0 && cur != (int)vec.size(); --j) {
        if(arr[i][j] == '?')
          continue;
        arr[i][j] = 'a' + cur;
        --vec[cur];
        if(vec[cur] == 0) {
          ++cur;
          if(cur == (int)vec.size())
            break;
        }
      }
    } else {
      for (int j = 0; j < a && cur != (int)vec.size(); ++j) {
        if(arr[i][j] == '?')
          continue;
        arr[i][j] = 'a' + cur;
        --vec[cur];
        if(vec[cur] == 0) {
          ++cur;
          if(cur == (int)vec.size())
            break;
        }
      }
    }
  }
}

int main() {
  fastIO;
  cin >> a >> b >> c >> d >> n;
  clr(arr, '?');

  for (int i = 0; i < b; ++i) {
    for (int j = 0; j < a; ++j) {
      arr[i][j] = '*';
    }
  }

  for (int i = 0; i < d; ++i) {
    for (int j = 0; j < c; ++j) {
      arr[i][j + a] = '*';
    }
  }

  for (int i = 0; i < n; ++i) {
    cin >> x;
    vec.push_back(x);
  }
  a += c;
  c = max(b, d);

  int dir = (min(b, d) & 1) ? 1 : 0;
  int dir2 = (arr[c-1][0] == '?') ? 1 : 0;
  if(!dir && !dir2) {
    path2();
  } else if(!dir && dir2) {
    path1();
  } else if(dir && dir2) {
    path2();
  } else {
    path1();
  }

  int rem = 0;
  for (int i = 0; i < n; ++i)
    rem += vec[i];
  if(rem > 0) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
    for (int i = 0; i < c; ++i) {
      for (int j = 0; j < a; ++j) {
        if(arr[i][j] == '?' || arr[i][j] == '*')
          arr[i][j] = '.';
        cout << arr[i][j];
      }
      cout << '\n';
    }
  }
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define int long long
#define endl '\n'
#define maxn 100010
const int MOD = 1000000007;
int a, b, c, d, n;

int f(int col) {
    return (col >= a) ? d : b;
}

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

    vector<vector<char>> mat(max(b, d), vector<char>(a + c, '.'));
    int col = 0, row = 0, del = 1;
    if (a % 2) {
        row = b - 1;
        del = -1;
    }
    char ch = 'a';
    for (int i = 0; i < n; i++) {
        int pts;
        cin >> pts;

        while (pts > 0) {
            mat[row][col] = ch;
            row += del;

            if (row < 0) {
                row++;
                del = 1;
                col++;
            } else if (row >= f(col)) {
                row--;
                col++;
                del = -1;
            }
            pts--;
        }
        ch++;
    }
    cout << "YES" << endl;
    for (auto &x: mat) {
        for (auto &y : x)
            cout << y;
        cout << endl;
    }
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    while (t--)
        solve();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ii pair<int, int>
int a, b, c, d, N;
int arr[30], cum[30];
vector<ii> v;
char ans[150][150];

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

    cin >> a >> b >> c >> d >> N;
    for (int i = 1; i <= N; i++) {
        cin >> arr[i];
        cum[i] = arr[i] + cum[i - 1];
    }

    for (int i = 0; i < max(b, d); i++) {
        for (int j = 0; j < a + c; j++) {
            ans[i][j] = '.';
        }
    }
    for (int j = 0; j < a + c; j++) {
        int colAmt = j < a ? b : d;
        vector<int> v1;
        for (int i = 0; i < colAmt; i++) {
            v1.push_back(i);
        }
        if (j % 2 != a % 2) {
            reverse(v1.begin(), v1.end());
        }
        for (auto x : v1) {
            v.push_back({x, j});
        }
    }
    cout << v.size() << endl;
    for (int i = 1; i <= N; i++) {
        char c = (char)('a' + i - 1);
        for (int j = cum[i - 1]; j < cum[i]; j++) {
            ans[v[j].first][v[j].second] = c;
        }
    }
    cout << "YES" << endl;
    for (int i = 0; i < max(b, d); i++) {
        for (int j = 0; j < a + c; j++) {
            cout << ans[i][j];
        }
        cout << endl;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ii pair<int, int>
int a, b, c, d, N;
int arr[30], cum[30];
vector<ii> v;
char ans[150][150];

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

    cin >> a >> b >> c >> d >> N;
    for (int i = 1; i <= N; i++) {
        cin >> arr[i];
        cum[i] = arr[i] + cum[i - 1];
    }

    for (int i = 0; i < max(b, d); i++) {
        for (int j = 0; j < a + c; j++) {
            ans[i][j] = '.';
        }
    }
    for (int j = 0; j < a + c; j++) {
        int colAmt = j < a ? b : d;
        vector<int> v1;
        for (int i = 0; i < colAmt; i++) {
            v1.push_back(i);
        }
        if (j % 2 != a % 2) {
            reverse(v1.begin(), v1.end());
        }
        for (auto x : v1) {
            v.push_back({x, j});
        }
    }
    for (int i = 1; i <= N; i++) {
        char c = (char)('a' + i - 1);
        for (int j = cum[i - 1]; j < cum[i]; j++) {
            ans[v[j].first][v[j].second] = c;
        }
    }
    cout << "YES" << endl;
    for (int i = 0; i < max(b, d); i++) {
        for (int j = 0; j < a + c; j++) {
            cout << ans[i][j];
        }
        cout << endl;
    }

    return 0;
}


#include<bits/stdc++.h>
#define ll  long long
#define ff first
#define ss second
#define pb push_back
#define pp pair<ll,ll>
#define maxn 100005
#define db double
#define mod 1000000007
using namespace std;
ll a,b,c,d,n;
void solve()
{
	cin >>a  >> b >> c >> d >> n;
	vector<ll> x(n);
	for(ll i=0;i<n;i++)
	{
		cin >> x[i];
	}
	vector<string> v(50);
	string temp;
	for(ll i=0;i<100;i++)
		temp += '.';
	for(ll i=0;i<50;i++)
		v[i]=temp;
	ll flag = 0;
	if(b < d)
		flag = 1;
	ll mini=min(b,d);
	ll maxi = max(b,d);
	pp start={0,0};
	ll dir = 1;
	if(flag == 0)
	{
		if(d%2)
		{
			start.ss = a+c-1;
			dir = -1;
		}
	}
	else{
		if(b%2 ==0)
		{
			start.ss = a+c-1;
			dir = -1;
		}
	}
	char l='a';
	v[start.ff][start.ss]=l;
	x[0]--;
	for(ll i=0;i<n;i++)
	{
		while(x[i] > 0)
		{
			if(start.ff < mini)
			{
				if(start.ss+dir >= 0 and start.ss+dir <a+c)
				{
					start.ss+=dir;
					v[start.ff][start.ss] = l;
				}
				else{
					start.ff++;
					v[start.ff][start.ss]=l;
					if(dir == -1)
						dir=1;
					else dir = -1;
				}
			}
			else if(flag == 0)
			{
				if(start.ss+dir >= 0 and start.ss+dir <a)
				{
					start.ss+=dir;
					v[start.ff][start.ss] = l;
				}
				else{
					start.ff++;
					v[start.ff][start.ss]=l;
					if(dir == -1)
						dir=1;
					else dir = -1;
				}
			}
			else {
				if(start.ss+dir >= a and start.ss+dir <c)
				{
					start.ss+=dir;
					v[start.ff][start.ss] = l;
				}
				else{
					start.ff++;
					v[start.ff][start.ss]=l;
					if(dir == -1)
						dir=1;
					else dir = -1;
				}
			}
			x[i]--;
		}
		l++;
	}
	cout << "YES" <<"\n"
	for(ll i=0;i<maxi;i++)
	{
		for(ll j=0;j<a+c;j++)
			cout << v[i][j];
		cout << "\n";
	}
}
int main()
{
	ll t=1,i=1;
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::cout.precision(10);
    std::cout.setf( std::ios::fixed, std:: ios::floatfield );
	//cin >> t;
	//cin >> n;
	while(i<=t)
	{
		solve();
		i++;
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll  long long
#define ff first
#define ss second
#define pb push_back
#define pp pair<ll,ll>
#define maxn 100005
#define db double
#define mod 1000000007
using namespace std;
ll a,b,c,d,n;
void solve()
{
	cin >>a  >> b >> c >> d >> n;
	vector<ll> x(n);
	for(ll i=0;i<n;i++)
	{
		cin >> x[i];
	}
	vector<string> v(50);
	string temp;
	for(ll i=0;i<100;i++)
		temp += '.';
	for(ll i=0;i<50;i++)
		v[i]=temp;
	ll flag = 0;
	if(b < d)
		flag = 1;
	ll mini=min(b,d);
	ll maxi = max(b,d);
	pp start={0,0};
	ll dir = 1;
	if(flag == 0)
	{
		if(d%2)
		{
			start.ss = a+c-1;
			dir = -1;
		}
	}
	else{
		if(b%2 ==0)
		{
			start.ss = a+c-1;
			dir = -1;
		}
	}
	char l='a';
	v[start.ff][start.ss]=l;
	x[0]--;
	for(ll i=0;i<n;i++)
	{
		while(x[i] > 0)
		{
			if(start.ff < mini)
			{
				if(start.ss+dir >= 0 and start.ss+dir <a+c)
				{
					start.ss+=dir;
					v[start.ff][start.ss] = l;
				}
				else{
					start.ff++;
					v[start.ff][start.ss]=l;
					if(dir == -1)
						dir=1;
					else dir = -1;
				}
			}
			else if(flag == 0)
			{
				if(start.ss+dir >= 0 and start.ss+dir <a)
				{
					start.ss+=dir;
					v[start.ff][start.ss] = l;
				}
				else{
					start.ff++;
					v[start.ff][start.ss]=l;
					if(dir == -1)
						dir=1;
					else dir = -1;
				}
			}
			else {
				if(start.ss+dir >= a and start.ss+dir <c)
				{
					start.ss+=dir;
					v[start.ff][start.ss] = l;
				}
				else{
					start.ff++;
					v[start.ff][start.ss]=l;
					if(dir == -1)
						dir=1;
					else dir = -1;
				}
			}
			x[i]--;
		}
		l++;
	}
	for(ll i=0;i<maxi;i++)
	{
		for(ll j=0;j<a+c;j++)
			cout << v[i][j];
		cout << "\n";
	}
}
int main()
{
	ll t=1,i=1;
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::cout.precision(10);
    std::cout.setf( std::ios::fixed, std:: ios::floatfield );
	//cin >> t;
	//cin >> n;
	while(i<=t)
	{
		solve();
		i++;
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll  long long
#define ff first
#define ss second
#define pb push_back
#define pp pair<ll,ll>
#define maxn 100005
#define db double
#define mod 1000000007
using namespace std;
ll a,b,c,d,n;
void solve()
{
	cin >>a  >> b >> c >> d >> n;
	vector<ll> x(n);
	for(ll i=0;i<n;i++)
	{
		cin >> x[i];
	}
	vector<string> v(50);
	string temp;
	for(ll i=0;i<100;i++)
		temp += '.';
	for(ll i=0;i<50;i++)
		v[i]=temp;
	ll flag = 0;
	if(b < d)
		flag = 1;
	ll mini=min(b,d);
	ll maxi = max(b,d);
	pp start={0,0};
	ll dir = 1;
	if(flag == 0)
	{
		if(d%2)
		{
			start.ss = a+c-1;
			dir = -1;
		}
	}
	else{
		if(b%2 ==0)
		{
			start.ss = a+c-1;
			dir = -1;
		}
	}
	char l='a';
	v[start.ff][start.ss]=l;
	x[0]--;
	for(ll i=0;i<n;i++)
	{
		while(x[i] > 0)
		{
			if(start.ff < mini)
			{
				if(start.ss+dir >= 0 and start.ss+dir <a+c)
				{
					start.ss+=dir;
					v[start.ff][start.ss] = l;
				}
				else{
					start.ff++;
					v[start.ff][start.ss]=l;
					if(dir == -1)
						dir=1;
					else dir = -1;
				}
			}
			else if(flag == 0)
			{
				if(start.ss+dir >= 0 and start.ss+dir <a)
				{
					start.ss+=dir;
					v[start.ff][start.ss] = l;
				}
				else{
					start.ff++;
					v[start.ff][start.ss]=l;
					if(dir == -1)
						dir=1;
					else dir = -1;
				}
			}
			else {
				if(start.ss+dir >= a and start.ss+dir <c)
				{
					start.ss+=dir;
					v[start.ff][start.ss] = l;
				}
				else{
					start.ff++;
					v[start.ff][start.ss]=l;
					if(dir == -1)
						dir=1;
					else dir = -1;
				}
			}
			x[i]--;
		}
		l++;
	}
	cout << "YES" <<"\n";
	for(ll i=0;i<maxi;i++)
	{
		for(ll j=0;j<a+c;j++)
			cout << v[i][j];
		cout << "\n";
	}
}
int main()
{
	ll t=1,i=1;
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::cout.precision(10);
    std::cout.setf( std::ios::fixed, std:: ios::floatfield );
	//cin >> t;
	//cin >> n;
	while(i<=t)
	{
		solve();
		i++;
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll  long long
#define ff first
#define ss second
#define pb push_back
#define pp pair<ll,ll>
#define maxn 100005
#define db double
#define mod 1000000007
using namespace std;
ll a,b,c,d,n;
void solve()
{
	cin >>a  >> b >> c >> d >> n;
	vector<ll> x(n);
	for(ll i=0;i<n;i++)
	{
		cin >> x[i];
	}
	vector<string> v(50);
	string temp;
	for(ll i=0;i<100;i++)
		temp += '.';
	for(ll i=0;i<50;i++)
		v[i]=temp;
	ll flag = 0;
	if(b < d)
		flag = 1;
	ll mini=min(b,d);
	ll maxi = max(b,d);
	pp start={0,0};
	ll dir = 1;
	if(flag == 0)
	{
		if(d%2)
		{
			start.ss = a+c-1;
			dir = -1;
		}
	}
	else{
		if(b%2 ==0)
		{
			start.ss = a+c-1;
			dir = -1;
		}
	}
	char l='a';
	v[start.ff][start.ss]=l;
	x[0]--;
	for(ll i=0;i<n;i++)
	{
		while(x[i] > 0)
		{
			if(start.ff < mini)
			{
				if(start.ss+dir >= 0 and start.ss+dir <a+c)
				{
					start.ss+=dir;
					v[start.ff][start.ss] = l;
				}
				else{
					start.ff++;
					v[start.ff][start.ss]=l;
					if(dir == -1)
						dir=1;
					else dir = -1;
				}
			}
			else if(flag == 0)
			{
				if(start.ss+dir >= 0 and start.ss+dir <a)
				{
					start.ss+=dir;
					v[start.ff][start.ss] = l;
				}
				else{
					start.ff++;
					v[start.ff][start.ss]=l;
					if(dir == -1)
						dir=1;
					else dir = -1;
				}
			}
			else {
				if(start.ss+dir >= a and start.ss+dir <a+c)
				{
					start.ss+=dir;
					v[start.ff][start.ss] = l;
				}
				else{
					start.ff++;
					v[start.ff][start.ss]=l;
					if(dir == -1)
						dir=1;
					else dir = -1;
				}
			}
			x[i]--;
		}
		l++;
	}
	cout << "YES" <<"\n";
	for(ll i=0;i<maxi;i++)
	{
		for(ll j=0;j<a+c;j++)
			cout << v[i][j];
		cout << "\n";
	}
}
int main()
{
	ll t=1,i=1;
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::cout.precision(10);
    std::cout.setf( std::ios::fixed, std:: ios::floatfield );
	//cin >> t;
	//cin >> n;
	while(i<=t)
	{
		solve();
		i++;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,d,n,x;
    cin>>a>>b>>c>>d>>n;
    string s;
    int cc=0;
    for (int i=0;i<n;i++)
    {
        cin>>x;
        cc+=x;
        while(x--)
        {
            s+=(char)(97+i);
        }
    }
    //cout<<s<<endl;
    int co=0;
    char arr[max(b,d)][a+c];
    if (max(b,d)==b)
    {
        for (int i=d;i<b;i++)
        {
            for (int j=a;j<a+c;j++)
                arr[i][j]='.';
        }
        int f=0;
        if (d%2==0)
        {
            for (int i=d-1;i>=0;i--)
            {
                if (f==0)
                {
                    for (int j=a;j<a+c;j++)
                    {
                        arr[i][j]=s[co];
                        co++;
                    }
                    f=1;
                }
                else
                {
                    for (int j=a+c-1;j>=a;j--)
                    {
                        arr[i][j]=s[co];
                        co++;
                    }
                    f=0;
                }

            }
        }
        else
        {
            for (int i=d-1;i>=0;i--)
            {
                if (f==1)
                {
                    for (int j=a;j<a+c;j++)
                    {
                        arr[i][j]=s[co];
                        co++;
                    }
                    f=0;
                    if(co==cc)
                        break;
                }
                else
                {
                    for (int j=a+c-1;j>=a;j--)
                    {
                        arr[i][j]=s[co];
                        co++;
                    }
                    f=1;
                    if(co==cc)
                        break;
                }

            }

        }
        int tm=0,bm=b-1,lm=0,rm=a-1;
        while(tm<=bm&&lm<=rm)
        {
            for (int j=rm;j>=lm;j--)
            {
                arr[tm][j]=s[co];
                co++;
            }
                    if(co==cc)
                        break;
            tm++;
            for (int j=tm;j<=bm;j++)
            {
                arr[j][lm]=s[co];
                co++;
            }
                                if(co==cc)
                        break;
            lm++;
            for (int j=lm;j<=rm;j++)
            {
                arr[bm][j]=s[co];
                co++;
            }
                                if(co==cc)
                        break;
            bm--;
            for (int j=bm;j>=tm;j--)
            {
                arr[j][rm]=s[co];
                co++;
            }
                                if(co==cc)
                        break;
            rm--;
        }
    }
    else
    {
        for (int i=b;i<d;i++)
        {
            for (int j=0;j<a;j++)
                arr[i][j]='.';
        }
        int f=1;
        if (b%2==0)
        {
            for (int i=b-1;i>=0;i--)
            {
                if (f==0)
                {
                    for (int j=a-1;j>=0;j--)
                    {
                        arr[i][j]=s[co];
                        co++;
                    }
                    f=1;
                                        if(co==cc)
                        break;
                }
                else
                {
                    for (int j=0;j<a;j++)
                    {
                        arr[i][j]=s[co];
                        co++;
                    }
                    f=0;
                                        if(co==cc)
                        break;
                }
            }
        }
        else
        {
            for (int i=b-1;i>=0;i--)
            {
                if (f==1)
                {
                    for (int j=0;j<a;j++)
                    {
                        arr[i][j]=s[co];
                        co++;
                    }
                    f=0;
                                        if(co==cc)
                        break;
                }
                else
                {
                    for (int j=a-1;j>=0;j--)
                    {
                        arr[i][j]=s[co];
                        co++;
                    }
                    f=1;
                                        if(co==cc)
                        break;
                }

            }

        }
        int tm=0,bm=d-1,lm=a,rm=a+c-1;
        while(tm<=bm&&lm<=rm)
        {
            for (int j=lm;j<=rm;j++)
            {
                arr[tm][j]=s[co];
                co++;
            }
            tm++;
                                if(co==cc)
                        break;
            for (int j=tm;j<=bm;j++)
            {
                //cout<<"lamba";
                arr[j][rm]=s[co];
                co++;
            }
            rm--;
                                if(co==cc)
                        break;
            for (int j=rm;j>=lm;j--)
            {
                arr[bm][j]=s[co];
                co++;
            }
            bm--;
                                if(co==cc)
                        break;
            for (int j=bm;j>=tm;j--)
            {
                arr[j][lm]=s[co];
                co++;
            }
            lm++;
                                if(co==cc)
                        break;
        }
    }
    cout<<"YES"<<endl;
    for (int i=0;i<max(b,d);i++)
    {
        for (int j=0;j<a+c;j++)
            cout<<arr[i][j];
        cout<<endl;
    }
    //cout<<arr[1][3]<<"da"<<endl;
}