import numpy as np
nlevels = 3
count = 0
for p1 in range(nlevels):
for p2 in range(nlevels):
iconfig = np.zeros(nlevels)
iconfig[p1] += 1
iconfig[p2] += 1
print('%s' % str(iconfig))
count+=1
print("Total number of microstates = ",count)