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

for i in range(M):
    s, t = map(int,input().split())
    for st in sets:
        if s in st or t in st:
            st.add(s)
            st.add(t)
            break
    sets.append({s,t})

ans = max([len(st) for st in sets])
print(ans)

Fixed submission:
class UnionFind():
    def __init__(self,n):
        self.n = n
        self.par = [-1]*(n+1)
    
    def find(self,x):
        if self.par[x] < 0:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
    
    def union(self,x,y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.par[x] > self.par[y]:
            x, y = y, x
        self.par[x] += self.par[y]
        self.par[y] = x

N, M = map(int,input().split())
uf = UnionFind(N)

for i in range(M):
    a, b = map(int,input().split())
    uf.union(a,b)

ans = -min(uf.par)
print(ans)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 30 01:08:52 2020

@author: liang
"""
N, M = map(int,input().split())
sets = list()

for i in range(M):
    s, t = map(int,input().split())
    for st in sets:
        if s in st or t in st:
            st.add(s)
            st.add(t)
            break
    sets.append({s,t})

ans = max([len(st) for st in sets])
print(ans)

Fixed submission:
class UnionFind():
    def __init__(self,n):
        self.n = n
        self.par = [-1]*(n+1)
    
    def find(self,x):
        if self.par[x] < 0:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
    
    def union(self,x,y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.par[x] > self.par[y]:
            x, y = y, x
        self.par[x] += self.par[y]
        self.par[y] = x

N, M = map(int,input().split())
uf = UnionFind(N)

for i in range(M):
    a, b = map(int,input().split())
    uf.union(a,b)

ans = -min(uf.par)
print(ans)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 30 01:08:52 2020

@author: liang
"""
N, M = map(int,input().split())
sets = list()

for i in range(M):
    s, t = map(int,input().split())
    for st in sets:
        if s in st or t in st:
            st.add(s)
            st.add(t)
            break
    sets.append({s,t})

ans = max([len(st) for st in sets])
print(ans)

Fixed submission:
class UnionFind():
    def __init__(self,n):
        self.n = n
        self.par = [-1]*(n+1)
    
    def find(self,x):
        if self.par[x] < 0:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
    
    def union(self,x,y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.par[x] > self.par[y]:
            x, y = y, x
        self.par[x] += self.par[y]
        self.par[y] = x

N, M = map(int,input().split())
uf = UnionFind(N)

for i in range(M):
    a, b = map(int,input().split())
    uf.union(a,b)

ans = -min(uf.par)
print(ans)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 30 01:08:52 2020

@author: liang
"""
N, M = map(int,input().split())
sets = list()

for i in range(M):
    s, t = map(int,input().split())
    for st in sets:
        if s in st or t in st:
            st.add(s)
            st.add(t)
            break
    sets.append({s,t})

ans = max([len(st) for st in sets])
print(ans)

Fixed submission:
class UnionFind():
    def __init__(self,n):
        self.n = n
        self.par = [-1]*(n+1)
    
    def find(self,x):
        if self.par[x] < 0:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
    
    def union(self,x,y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.par[x] > self.par[y]:
            x, y = y, x
        self.par[x] += self.par[y]
        self.par[y] = x

N, M = map(int,input().split())
uf = UnionFind(N)

for i in range(M):
    a, b = map(int,input().split())
    uf.union(a,b)

ans = -min(uf.par)
print(ans)

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

for i in range(M):
    s, t = map(int,input().split())
    for st in sets:
        if s in st or t in st:
            st.add(s)
            st.add(t)
            break
    sets.append({s,t})

ans = max([len(st) for st in sets])
print(ans)

Fixed submission:
class UnionFind():
    def __init__(self,n):
        self.n = n
        self.par = [-1]*(n+1)
    
    def find(self,x):
        if self.par[x] < 0:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
    
    def union(self,x,y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.par[x] > self.par[y]:
            x, y = y, x
        self.par[x] += self.par[y]
        self.par[y] = x

N, M = map(int,input().split())
uf = UnionFind(N)

for i in range(M):
    a, b = map(int,input().split())
    uf.union(a,b)

ans = -min(uf.par)
print(ans)