#include <stdio.h>
#include <cmath>
#include <algorithm>

int left,right;

void recursive(short table[11],short index,int left_count,int right_count){
	if(index == left+right){

		for(int i = 0; i < index; i++){
			if(table[i] == 0)printf("A");
			else{
				printf("B");
			}
		}
		printf("\n");
		return;
	}

	if(left >= 4 && right >= 4){

		if(left_count == 4 && right_count == 4){

			for(int i = 0; i < index; i++){
				if(table[i] == 0)printf("A");
				else{
					printf("B");
				}
			}

			if(left == 6 && right == 4){
				printf("AA\n");
			}else if(left == 5 && right == 4){
				printf("A\n");
			}else if(left == 4 && right == 6){
				printf("BB\n");
			}else if(left == 4 && right == 5){
				printf("B\n");
			}else if(left == 5 && right == 5){
				printf("AB\n");

				for(int i = 0; i < index; i++){
					if(table[i] == 0)printf("A");
					else{
						printf("B");
					}
				}
				printf("BA\n");
			}else{ //left == 4 && right == 4
				 //Do nothing
			}
			return;
		}else if(left_count == 4 && right_count <= 3){
			short new_table[11];
			for(int i = 0; i < 11; i++)new_table[i] = table[i];
			new_table[index] = 1;
			recursive(new_table,index+1,left_count,right_count+1);

		}else if(left_count <= 3 && right_count == 4){
			short new_table[11];
			for(int i = 0; i < 11; i++)new_table[i] = table[i];
			new_table[index] = 0;
			recursive(new_table,index+1,left_count+1,right_count);
		}else{
			if(left_count < left){
				short new_table[11];
				for(int i = 0; i < 11; i++)new_table[i] = table[i];
				new_table[index] = 0;
				recursive(new_table,index+1,left_count+1,right_count);
			}

			if(right_count < right){
				short new_table[11];
				for(int i = 0; i < 11; i++)new_table[i] = table[i];
				new_table[index] = 1;
				recursive(new_table,index+1,left_count,right_count+1);
			}
		}

	}else if(left == 5){
		if(left_count <= 3){

			if(left_count < left){
				short new_table[11];
				for(int i = 0; i < 11; i++)new_table[i] = table[i];
				new_table[index] = 0;
				recursive(new_table,index+1,left_count+1,right_count);
			}

			if(right_count < right){
				short new_table[11];
				for(int i = 0; i < 11; i++)new_table[i] = table[i];
				new_table[index] = 1;
				recursive(new_table,index+1,left_count,right_count+1);
			}

		}else{
			if(right - right_count > 0){
				short new_table[11];
				for(int i = 0; i < 11; i++)new_table[i] = table[i];
				new_table[index] = 1;
				recursive(new_table,index+1,left_count,right_count+1);
			}else{
				short new_table[11];
				for(int i = 0; i < 11; i++)new_table[i] = table[i];
				new_table[index] = 0;
				recursive(new_table,index+1,left_count+1,right_count);
			}
		}
	}else if(right == 5){
		if(right_count <= 3){

			if(left_count < left){
				short new_table[11];
				for(int i = 0; i < 11; i++)new_table[i] = table[i];
				new_table[index] = 0;
				recursive(new_table,index+1,left_count+1,right_count);
			}

			if(right_count < right){
				short new_table[11];
				for(int i = 0; i < 11; i++)new_table[i] = table[i];
				new_table[index] = 1;
				recursive(new_table,index+1,left_count,right_count+1);
			}

		}else{
			if(left - left_count > 0){
				short new_table[11];
				for(int i = 0; i < 11; i++)new_table[i] = table[i];
				new_table[index] = 0;
				recursive(new_table,index+1,left_count+1,right_count);
			}else{
				short new_table[11];
				for(int i = 0; i < 11; i++)new_table[i] = table[i];
				new_table[index] = 1;
				recursive(new_table,index+1,left_count,right_count+1);
			}
		}

	}else{

		if(left_count < left){
			short new_table[11];
			for(int i = 0; i < 11; i++)new_table[i] = table[i];
			new_table[index] = 0;
			recursive(new_table,index+1,left_count+1,right_count);
		}

		if(right_count < right){
			short new_table[11];
			for(int i = 0; i < 11; i++)new_table[i] = table[i];
			new_table[index] = 1;
			recursive(new_table,index+1,left_count,right_count+1);
		}
	}
}

int main(){

	short table[11];
	for(int i = 0; i < 10;i++)table[i] = -1;

	scanf("%d %d",&left,&right);
	recursive(table,0,0,0);

	return 0;
}

Measured memory_bytes: 2616