#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <cstring>
#include <map>
#include <vector>
#include <array>
#include <ctime>
using namespace std;
typedef long long ll;
typedef array<array<ll, 2>, 2> matr;
inline matr mult(const matr& l, const matr& r, const ll MOD)
{
matr ans;
for (int i = 0; i < 2; ++i)
for (int j = 0; j < 2; ++j)
ans[i][j] = (l[i][0] * r[0][j] + l[i][1] * r[i][1]) % MOD;
return ans;
}
inline matr binpow(matr a, ll pow, const ll MOD)
{
matr cur;
for (int i = 0; i < 2; ++i)
for (int j = 0; j < 2; ++j)
a[i][j] = (a[i][j] % MOD + MOD) % MOD;
cur[0][0] = cur[1][1] = 1;
cur[0][1] = cur[1][0] = 0;
while (pow)
{
if (pow & 1) cur = mult(cur, a, MOD);
a = mult(a, a, MOD);
pow >>= 1;
}
return cur;
}
ll rows, cols;
ll sr, sc;
ll n;
const int N = 2001;
char lastColorRow[N];
char lastColorCol[N];
ll lastTimeRow[N];
ll lastTimeCol[N];
char ans[N][N];
inline pair<ll, ll> calcLastPos(ll x0, ll y0)
{
matr def;
def[0][0] = def[1][1] = 1;
def[0][1] = -2;
def[1][0] = 0;
matr mX = binpow(def, n / 4, cols);
matr mY = binpow(def, n / 4, rows);
ll x = (mX[0][0] * x0 + mX[0][1]) % cols;
ll y = (mY[0][0] * y0 + mY[0][1]) % cols;
ll steps = n % 4;
ll step = n - steps + 1;
if (steps >= 1){
y = (y + step) % rows;
++step;
}
if (steps >= 2){
x = (x + step) % cols;
++step;
}
if (steps >= 3){
y = ((y - step) % rows + rows) % rows;;
++step;
}
return make_pair(x, y);
}
int main() {
ios_base::sync_with_stdio(false);
cin >> rows >> cols >> sr >> sc >> n;
clock_t beg = clock();
memset(lastColorRow, '.', sizeof(lastColorRow));
memset(lastColorCol, '.', sizeof(lastColorCol));
memset(ans, '.', sizeof(ans));
memset(lastTimeRow, -1, sizeof(lastTimeRow));
memset(lastTimeCol, -1, sizeof(lastTimeCol));
pair<ll, ll> t = calcLastPos(sc - 1, rows - sr);
ll x = t.first;
ll y = t.second;
//0 - down
//1 - right
//2 - up
//3 - left
int dir = (n % 4 + 3) % 4;
char curcol = (n - 1) % 26 + 'a';
for (int step = n; step > 0/* && (clock() - beg) * 10 < 8LL * CLOCKS_PER_SEC*/; --step, dir = (dir + 1) % 4)
{
if (dir == 0)
{
if (step >= rows)
{
y = ((y - step) % rows + rows) % rows;
lastColorCol[x] = curcol;
lastTimeCol[x] = step;
}
else
{
for (int i = 0; i < step; ++i)
{
--y; if (y == -1) y = rows - 1;
ans[x][y] = curcol;
}
}
}
if (dir == 2)
{
if (step >= rows)
{
y = ((y + step) % rows + rows) % rows;
lastColorCol[x] = curcol;
lastTimeCol[x] = step;
}
else
{
for (int i = 0; i < step; ++i)
{
++y; if (y == rows) y = 0;
ans[x][y] = curcol;
}
}
}
if (dir == 3) //left
{
if (step >= cols)
{
x = ((x - step) % cols + cols) % cols;
lastColorRow[y] = curcol;
lastTimeRow[y] = step;
}
else
{
for (int i = 0; i < step; ++i)
{
--x; if (x == -1) x = cols - 1;
ans[x][y] = curcol;
}
}
}
if (dir == 1) //right
{
if (step >= cols)
{
x = ((x + step) % cols + cols) % cols;
lastColorRow[y] = curcol;
lastTimeRow[y] = step;
}
else
{
for (int i = 0; i < step; ++i)
{
++x; if (x == cols) x = 0;
ans[x][y] = curcol;
}
}
}
if (curcol == 'a') curcol = 'z';
else --curcol;
}
for (int i = 0; i < cols; ++i){
for (int j = 0; j < rows; ++j)
{
char col = lastColorCol[i];
ll t = lastTimeCol[i];
if (lastTimeRow[j] > lastTimeCol[i]){
char col = lastColorRow[j];
char t = lastTimeRow[j];
}
if (t > 0) ans[i][j] = col;
}
}
ans[t.first][t.second] = '@';
for (int row = rows - 1; row >= 0; --row){
for (int c = 0; c < cols; ++c)
cout << ans[row][c];
cout << endl;
}
return 0;
}