/* author: Leonardone @ NEETSDKASU */
#include <stdio.h>

void string(char c, int n) {
	while (n-- > 0) {
		putchar(c);
	}
}

void printItem(int p) {
	if (p < 10) {
		putchar('0' + p);
	} else if (p < 36) {
		putchar('A' + p - 10);
	} else {
		putchar('a' + p - 36);
	}	
}

void btree(int n) {
	int a = (1 << n) - 1;
	int b = ((a + 1) >> 1) - 1;
	int c = 1;
	int p = 1;
	int i, j;
	
	for (i = 0; i < n; i++) {
		string(' ', b);
		for (j = 0; j < c; j++) {
			if (j > 0) {
				string(' ', a);
			}
			printItem(p);
			p++;
		}
		c <<= 1;
		a = b;
		b = ((a + 1) >> 1) - 1;
		putchar('\n');
	}
}


int main(void) {
	int i;
	
	for (i = 1; i <= 6; i++) {
		btree(i);
		string('-', 64);
		putchar('\n');
	}
	
	return 0;
}
