def f(x):
    return ((2*x) + 1)


def onto(f, domain, codomain):
	marked = [False] * len(codomain)
	for i in range(0, len(domain)):
		marked[domain[f[i]] = True
	for i in range(0, len(codomain)):
		if not marked[i]: return False
	return True


A = {1, 2, 3}, B = {4, 5} 