inList = [[1,2],[3,4],[1,13],[4,52],[7,13],[77,52],[6,2],[0,3]]
dd =[]
i = len(inList)
x = 0
while i > 0:
pop1 = inList.pop(0)
dd.append(pop1)
for j in pop1:
for n,k in enumerate(inList):
if k.count(j) != int(0):
dd[x].extend(inList.pop(n))
i = len(inList)
x = x + 1
uniq =[]
for i in dd:
if len(set(i)) > 1:
uniq.append(sorted(set(i)))