Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())

color = []
colorStorage = []
for i in range(N):
    color.append(i)
    colorStorage.append([i])

for _ in range(M):
    p,q = map(int,input().split())
    p -= 1
    q -= 1
    if color[p] == color[q]:
        continue
    else:
        x = color[p]
        y = color[q]
        if len(colorStorage[x]) >= len(colorStorage[y]):
            for elem in colorStorage[y]:
                color[elem] = x
                colorStorage[x].append(elem)
            colorStorage[y] = []
        else:
            for elem in colorStorage[y]:
                color[elem] = y
                colorStorage[y].append(elem)
            colorStorage[x] = []
maxL = 0
for colorList in colorStorage:
    if maxL < len(colorList):
        maxL = colorList
print(maxL)



Fixed submission:
N,M = map(int,input().split())

color = []
colorStorage = []
for i in range(N):
    color.append(i)
    colorStorage.append([i])

for _ in range(M):
    p,q = map(int,input().split())
    p -= 1
    q -= 1
    if color[p] == color[q]:
        continue
    else:
        x = color[p]
        y = color[q]
        if len(colorStorage[x]) >= len(colorStorage[y]):
            for elem in colorStorage[y]:
                color[elem] = x
                colorStorage[x].append(elem)
            colorStorage[y] = []
        else:
            for elem in colorStorage[x]:
                color[elem] = y
                colorStorage[y].append(elem)
            colorStorage[x] = []
maxL = 0
for colorList in colorStorage:
    if maxL < len(colorList):
        maxL = len(colorList)
print(maxL)

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())

color = []
colorStorage = []
for i in range(N):
    color.append(i)
    colorCount.append([i])

for _ in range(M):
    p,q = map(int,input().split())
    p -= 1
    q -= 1
    if color[p] == color[q]:
        continue
    else:
        x = color[p]
        y = color[q]
        if len(colorStorage[x]) >= len(colorStorage[y]):
            for elem in colorStorage[y]:
                color[elem] = x
                colorStorage[x].append(elem)
            colorStorage[y] = []
        else:
            for elem in colorStorage[y]:
                color[elem] = y
                colorStorage[y].append(elem)
            colorStorage[x] = []
maxL = 0
for colorList in colorStorage:
    if maxL < len(colorList):
        maxL = colorList
print(maxL)



Fixed submission:
N,M = map(int,input().split())

color = []
colorStorage = []
for i in range(N):
    color.append(i)
    colorStorage.append([i])

for _ in range(M):
    p,q = map(int,input().split())
    p -= 1
    q -= 1
    if color[p] == color[q]:
        continue
    else:
        x = color[p]
        y = color[q]
        if len(colorStorage[x]) >= len(colorStorage[y]):
            for elem in colorStorage[y]:
                color[elem] = x
                colorStorage[x].append(elem)
            colorStorage[y] = []
        else:
            for elem in colorStorage[x]:
                color[elem] = y
                colorStorage[y].append(elem)
            colorStorage[x] = []
maxL = 0
for colorList in colorStorage:
    if maxL < len(colorList):
        maxL = len(colorList)
print(maxL)