import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
int x=sc.nextInt();
int y=sc.nextInt();
int a=sc.nextInt();
int b=sc.nextInt();
//只创建该范围内的矩阵
char[][] arr=new char[b][a];
for (char[] p:arr)
{
Arrays.fill(p, '.');
}
int A=t/2;
int B=t-a;
//(i,i)
for (int i=(x+y)/2;i<t;i++)
{
if (i+i>x+a-1+y+b-1)
{
break;
}
//A
if (i%2==0)
{
//i,i
//x是列
//y是行
if (i>=x&&i<=x+a-1&&i>=y&&y<=y+b-1)
{
arr[i-y][i-x]='A';
}
if (2*i>=x&&2*i<=x+a-1&&0>=y&&0<=y+b-1)
{
arr[0-y][i*2-x]='A';
}
}
//B
else
{
int count=0;
for (int j=0;j<2*i;j++)
{
int row=i-j;
int col=i+j;
// System.out.println("row:"+row);
// System.out.println("col:"+col);
if (col>=x&&col<=x+a-1&&row>=y&&row<=y+b-1)
{
arr[row-y][col-x]='B';
count++;
}
}
}
}
//System.out.println("i:"+i);
for (int j=y+b-1;j>=y;j--)
{
for (int i=x;i<=x+a-1;i++)
{
// System.out.println(i-y);
// System.out.println(j-x);
// System.out.println();
System.out.print(arr[j-y][i-x]);
}
System.out.println();
}
return;
}
}