from itertools import product
from collections import defaultdict

notes = {'C': 0, 'C#': 1, 'Db': 1, 'D': 2, 'D#': 3, 'Eb': 3, 'E': 4, 'F': 5, 'F#': 6, 'Gb': 6, 'G': 7, 
		'G#': 8, 'Ab': 8, 'A': 9, 'A#': 10, 'Bb': 10, 'B': 11}

notes_list = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B']

def power(s, n):
	if not isinstance(s, set) and not isinstance(n, int):
		raise TypeError("Invalid types")

	d = defaultdict(dict)

	sub = ""
	for i in range(n):
		sub += "s,"

	sub = sub[:-1]

	l = eval("list(product(%s))" % sub)
	for i in l:
		for j in s:
			d[i][j] = 0

	return d