from random import randint

ornaments = 'NiXJo%b'
o_dict = {idx:ornament for idx, ornament in enumerate(ornaments)}

def get_ornaments(width:int):
	result = []
	randmax = len(ornaments) * 2
	for _ in range(width):
		key = randint(0, randmax)
		result.append(o_dict.get(key, '*'))
	return ''.join(result)

def get_treebody(height:int):
	result = []
	for h in range(height + 1):
		if h:
			result.append(get_ornaments(h * 2))
	return result

def adjust_pos(body:list):
	width = max(map(len, body))
	return ['{0:^{1}}'.format(b, width) for b in body]

def build_tree(height:int):
	tree = ['☆', '||']
	body = get_treebody(height)
	tree[1:1] = body
	return '\n'.join(adjust_pos(tree))

for x in range(7):
	print(build_tree(x))
